You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm learning how to use go modules and trying to convert my project to use them but I'm getting an error from this package when try to build it.
When I run: go get github.com/golang/freetype then I get
go: finding github.com/golang/freetype latest
go: finding github.com/golang/freetype/truetype latest
go build github.com/golang/freetype/truetype: no Go files in
It could just be the fact that I'm not using these modules properly or maybe I need to restructure my code, I just though I should ask about this just in case it could help solve my problem.
If I can get it working again, I'll close this issue.
The text was updated successfully, but these errors were encountered:
$ go mod init foo
go: creating new go.mod: module foo
$ go get -u github.com/golang/freetype
go: finding github.com/golang/freetype latest
go: finding golang.org/x/image/math/fixed latest
go: finding golang.org/x/image/font latest
go: finding golang.org/x/image/math latest
go: finding golang.org/x/image latest
$ cat main.go
package main
import (
"fmt"
"github.com/golang/freetype"
)
func main() {
context := freetype.NewContext()
fixed := context.PointToFixed(64.0)
fmt.Printf("%d\n",fixed)
}
$ go build .
$ ./foo
4096
You shouldn't need go.mod/go.sum for this to work.
Can you share how you created your repo (the commands you ran), and where it is in relation to your GOPATH? I think you might have issues with it being in your GOPATH, based on the ../../../go/pkg, I'd recommend moving it out of your GOPATH or trying export GO111MODULE=on then building again.
I'm learning how to use go modules and trying to convert my project to use them but I'm getting an error from this package when try to build it.
When I run:
go get github.com/golang/freetype
then I getWhen I try to build my code I get
It could just be the fact that I'm not using these modules properly or maybe I need to restructure my code, I just though I should ask about this just in case it could help solve my problem.
If I can get it working again, I'll close this issue.
The text was updated successfully, but these errors were encountered: