获取命令行参数的值
(fflags *pflag.FlagSet, flag string)
| 506 | |
| 507 | // 获取命令行参数的值 |
| 508 | func getFlagValue(fflags *pflag.FlagSet, flag string) string { |
| 509 | value, err := fflags.GetString(flag) |
| 510 | if err != nil { |
| 511 | if strings.Contains(err.Error(), "flag accessed but not defined:") { // 错误判断,不需要双语 |
| 512 | common.SmartIDELog.Debug(err.Error()) |
| 513 | } else { |
| 514 | common.SmartIDELog.Error(err) |
| 515 | } |
| 516 | |
| 517 | } |
| 518 | return value |
| 519 | } |
| 520 | |
| 521 | /* // 友好的错误 |
| 522 | type FriendlyError struct { |
no test coverage detected