herrjulz / aviator

Merge YAML/JSON files in a in a convenient fashion based on a configuration file called aviator.yml
MIT License
60 stars 7 forks source link

Not able to build the binary from main.go #15

Closed qu1queee closed 6 years ago

qu1queee commented 7 years ago

Its there a reason why some methods used in main.go are defined in another file call flags.go? When trying to generate the binary via the go build I have the following error:

# command-line-arguments
./main.go:14: undefined: setCli

If I defined the methods from flags.go into the main.go, then I do not have a problem anymore.

Regards, Enrique Encalada

herrjulz commented 7 years ago

the root of aviator is the main package and both main.go and flags.go are related to the main package. So if you want to build aviator with go build you need to build the whole package. $ go build main.go is not enough, as it uses function from other files, like in this case flags.go.

regards