Skip to content

Conversation

@mordyovits
Copy link

Fixed a conflation of types between a filename and the *config.Config (source
and target). The fmt was using a %s and meant the filename but used the nil
*config.Config

Removed an erroneous strconv.Itoa. The fmt was using %d anyway.

Fixed a conflation of types between a filename and the *config.Config (source
and target).  The fmt was using a %s and meant the filename but used the nil
*config.Config

Removed an erroneous strconv.Itoa.  The fmt was using %d anyway.
type.go Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt.Errorf

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it to that when I get a chance.

@robfig
Copy link
Owner

robfig commented Dec 7, 2014

I don't get it -- what does renaming to *_fn fix? (Also, Go uses lowerCamel, not snake_case)

@mordyovits
Copy link
Author

The problem is in line 367:
target, error := ReadDefault(target) <-- notice how target changed types
if error != nil {
t.Fatalf("Unable to read target config file '%s'", target) <-- but is then used as if it's a string (filename)

So my patch makes clear what's a *Config and what's a string. Without my patch, whenever line 367 calls Fatalf(), what it prints is nil, not the intended filename.

The same problem was with source.

@mordyovits
Copy link
Author

Ok, fixed all the issues you raised, and it passes go test and go vet is still clean.

robfig added a commit that referenced this pull request Dec 7, 2014
@robfig robfig merged commit 0f78529 into robfig:master Dec 7, 2014
@robfig
Copy link
Owner

robfig commented Dec 7, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants