writeGlobalConfigNode writes the YAML document to the given path.
(path string, doc *yaml.Node)
| 204 | |
| 205 | // writeGlobalConfigNode writes the YAML document to the given path. |
| 206 | func writeGlobalConfigNode(path string, doc *yaml.Node) error { |
| 207 | f, err := os.Create(path) |
| 208 | if err != nil { |
| 209 | return err |
| 210 | } |
| 211 | defer f.Close() |
| 212 | enc := yaml.NewEncoder(f) |
| 213 | enc.SetIndent(2) |
| 214 | if err := enc.Encode(doc); err != nil { |
| 215 | return err |
| 216 | } |
| 217 | return enc.Close() |
| 218 | } |
| 219 | |
| 220 | // findProjectsSequence locates the "projects" sequence node in the mapping. |
| 221 | // Returns nil if not found. |
no outgoing calls
no test coverage detected