Closed rmescandon closed 7 years ago
Can you please say why you want to refactor the source tree?
done
So the purpose is to allow building/running the code locally in the source tree, in addition to building/running the code as a snap? (Excellent goal by the way)
Yes, exactly. The goal is allowing building the snap, launch go test scripts to verify them, run go code locally or even including packages in other go code out of this project
can you please show how to run go locally, for example: cmds/netman/cmd_netman.go
go run cmds/netman/cmd_netman.go should be enough
you need to have the project in $GOPATH/src/github.com/CanonicalLtd/UCWifiConnect for go run cmds/netman/cmd_netman.go to work ok
Moved go code to the root of the project
Current folders structure doesn't let getting packages paths properly, as its complete path includes "src" currently, so that an import like "github.com/CanonicalLtd/UCWifiConnect/netman" would not get that package as it will be found at "github.com/CanonicalLtd/UCWifiConnect/src/netman". This is not a problem when building snap as "github.com/CanonicalLtd/UCWifiConnect" is taken as the local path to the sources, no matter where the sources are locally. But that's a problem if referring those packages from other go code, as they will be searched in that location in repository and not found. (go get will not find them)