I know this question has been asked before and I've tried all possible answers, but nothing still didn't help me.
However to refresh the question again and to elaborate my problem. I'm actually trying to include a simple file to the main.go file. My folder structure and the rest of the information as follows:
\src\
Multi-file\
lib\Car.go
main.go
Car.go
package main
type Car struct {
numberOfDoors int
cylinders int
}
main.go
package main
import (
"fmt"
)
func main() {
c := Car{4,6}
fmt.Println(c)
}
When I complie the main.go I'm getting the following error
# command-line-arguments
.\main.go:8: undefined: Car
Here is my go env details:
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\xampp\htdocs\golang
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GO15VENDOREXPERIMENT=
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
FYI: I tried including as package also that didn't even help me out.
Any help would be extremely appreciated.