Skip to content

Commit

Permalink
shadowed err variable created
Browse files Browse the repository at this point in the history
it makes the return value always nil
  • Loading branch information
jackielii committed Oct 6, 2016
1 parent 837cf8e commit ba59512
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (fs OSUtil) Mkdirs(dir string) error {
// file with the given text
func (fs OSUtil) AppendOrCreate(filePath string, text string) error {
var err error
if _, err := os.Stat(filePath); err == nil {
if _, err = os.Stat(filePath); err == nil {
err = AppendToFile(filePath, text)
} else {
err = ioutil.WriteFile(filePath, []byte(text), 0700)
Expand Down

0 comments on commit ba59512

Please sign in to comment.