Apr 20, 2017

[Go] package in same folder

How to specify the package name if multiple files exist in the package folder and one file contains the “package main”?

Go files in the same package AKA folder must have the same package name. 
The only exception are tests that can have a _test extension.
The rule is 1 folder , 1 package therefore the same package name for all go files in the same folder.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.