(envMap map[string]string, filename string, orders []string)
| 41 | } |
| 42 | |
| 43 | func WriteWithOrder(envMap map[string]string, filename string, orders []string) error { |
| 44 | content, err := MarshalWithOrder(envMap, orders) |
| 45 | if err != nil { |
| 46 | return err |
| 47 | } |
| 48 | file, err := os.Create(filename) |
| 49 | if err != nil { |
| 50 | return err |
| 51 | } |
| 52 | defer file.Close() |
| 53 | _, err = file.WriteString(content + "\n") |
| 54 | if err != nil { |
| 55 | return err |
| 56 | } |
| 57 | return file.Sync() |
| 58 | } |
| 59 | |
| 60 | func MarshalWithOrder(envMap map[string]string, orders []string) (string, error) { |
| 61 | lines := make([]string, 0, len(envMap)) |
nothing calls this directly
no test coverage detected