I have a Go project. When I run the program main.go
(with function main
), it serves a web server serving a JSON object.
In the same folder I have another file serializedata.go
(with function main
) which writes the JSON object into a file that is served by the web server.
Now, when I try to run go install
I get this error:
./serialize_data.go:17: main redeclared in this block previous declaration at ./main.go:13
I want to keep both these files together as they are related. The test data needs to be serialized before it can be served.
How can I prevent to build the serialization.go
file?
I'm from python world and there it's easy to have these utils files separately.