Skip to content

Commit

Permalink
fix: gofumpt
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Nov 4, 2024
1 parent 1fd1582 commit e42d7f6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion cmd/snips/generatecmd/watcher/watch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ func TestShouldIncludeFile(t *testing.T) {
}
})
}

}
1 change: 1 addition & 0 deletions cmd/snips/sloghandler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var levelToIcon = map[slog.Level]string{
slog.LevelWarn: "(!)",
slog.LevelError: "(✗)",
}

var levelToColor = map[slog.Level]*color.Color{
slog.LevelDebug: color.New(color.FgCyan),
slog.LevelInfo: color.New(color.FgGreen),
Expand Down
2 changes: 2 additions & 0 deletions generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (g *generator) writeCodeGeneratedComment() (err error) {
_, err = g.w.Write("// Code generated by snips - DO NOT EDIT.\n\n")
return err
}

func (g *generator) writeVersionComment() (err error) {
if g.version != "" {
_, err = g.w.Write("// snips: version: " + g.version + "\n")
Expand All @@ -115,6 +116,7 @@ func (g *generator) writeGeneratedDateComment() (err error) {
}
return err
}

func (g *generator) writePackage() error {
// package ...
_, err := g.w.Write("package snips")
Expand Down
4 changes: 2 additions & 2 deletions package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func createTempDir(t *testing.T) string {

func createTempFile(t *testing.T, path, content string) {
t.Helper()
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(path, []byte(content), 0644); err != nil {
if err := os.WriteFile(path, []byte(content), 0o644); err != nil {
t.Fatal(err)
}
}

0 comments on commit e42d7f6

Please sign in to comment.