| Conditions | 3 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package output |
||
| 41 | return err |
||
| 42 | } |
||
| 43 | |||
| 44 | return ioutil.WriteFile(fileName, []byte(decorated), 0666) |
||
| 45 | } |
||
| 46 | |||
| 47 | // decorate applies some decorations like formatting and empty import removal. |
||
| 48 | func (w FileWriter) decorate(content string) (decorated string, err error) { |
||
| 49 | for _, decorator := range w.decorators { |
||
| 50 | content, err = decorator.Decorate(content) |
||
| 51 | if err != nil { |
||
| 52 | return content, err |
||
| 53 | } |
||
| 54 | } |
||
| 58 |