(path, contents string)
| 32 | } |
| 33 | |
| 34 | func SaveFile(path, contents string) error { |
| 35 | if path == "-" { |
| 36 | _, err := fmt.Fprint(os.Stdout, contents) |
| 37 | return err |
| 38 | } else { |
| 39 | file, err := os.Create(path) |
| 40 | if err != nil { |
| 41 | return err |
| 42 | } |
| 43 | defer file.Close() |
| 44 | _, err = file.WriteString(contents) |
| 45 | return err |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | func SavePNG(path string, im image.Image) error { |
| 50 | file, err := os.Create(path) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…