(Documenting an answer as it looks unanswered at first glance)
The package
declaration on both files should be package utils
and they should be imported with:
import "github.com/user/repository/utils"
Its also possible to make sub-packages (standard library io
package has io/ioutil
) if you really want to separate each code file as separate packages.
import "github.com/user/repository/utils"
import "github.com/user/repository/utils/sub"
The local directory structure would be:
$GOPATH/src/
|___github.com/
|___user/
|___repository/
|___main.go
|___utils/
|___core.go
|___sub/factory.go
(Answer details posted in comment by @phndiaye)