(conf string, file string)
| 12 | ) |
| 13 | |
| 14 | func GetSecret(conf string, file string) string { |
| 15 | if conf == "" && file == "" { |
| 16 | return "" |
| 17 | } |
| 18 | |
| 19 | if conf != "" { |
| 20 | return conf |
| 21 | } |
| 22 | |
| 23 | contents, err := ReadFile(file) |
| 24 | if err != nil { |
| 25 | return "" |
| 26 | } |
| 27 | |
| 28 | return ParseSecretFile(contents) |
| 29 | } |
| 30 | |
| 31 | func ParseSecretFile(contents string) string { |
| 32 | lines := strings.Split(contents, "\n") |