Skip to content

Commit

Permalink
Moved linter settings to a file, fixed linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Juqueira committed Feb 5, 2020
1 parent 1ec9c8a commit cf8ac25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ linters:
disable:
- maligned
- prealloc
- gosec
disable-all: false
presets:
- bugs
Expand Down
5 changes: 4 additions & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ func initialize() error {

defer func() {
if err != nil && configPath != "" {
os.RemoveAll(configPath)
err = os.RemoveAll(configPath)
if err != nil {
fmt.Printf("unable to clean up files %v", err)
}
}
}()

Expand Down
7 changes: 5 additions & 2 deletions pkg/templates/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func Generate(c *goproject.Config, p *Project) error {

fullPath := filepath.Join(cwd, p.Name)

err = os.Mkdir(fullPath, 0777)
err = os.Mkdir(fullPath, 0750)
if err != nil {
return fmt.Errorf("unable to create project directory: %v", err)
}
Expand Down Expand Up @@ -195,7 +195,10 @@ func applyProjectToTemplates(p *Project, path string) error {
})

for _, f := range filesToRemove {
os.Remove(f)
err := os.Remove(f)
if err != nil {
fmt.Printf("unable to remove file %s %v", f, err)
}
}

return walkErr
Expand Down

0 comments on commit cf8ac25

Please sign in to comment.