#Whatever i do , I cannot install a package.

9 messages · Page 1 of 1 (latest)

steel moat
#

Please, help .
I'm trying to install the package "pixel"(https://pkg.go.dev/github.com/faiface/pixel#section-readme), and i tried go install, go get i tried setting go111something , go mod tidy , and all that, but nothing works.
it seams that it wants to find the package locally, but not from the internet.

zinc iris
steel moat
#

This is the biggest problem i'm facing. when i try to run the program (```
package main

import (
"pixel/pixelgl"
)

func main() {
pixelgl.Run(run)
}

zinc iris
#

You're importing the wrong thing

steel moat
#

That's what that looks like

zinc iris
#

Did you use go mod init to set up your project?

#

That command creates a go.mod file that will hold your project's dependencies.
After that you use go get to use a dependency and write the full path in the import statement.

#

Usually what I do is start my project with go mod init myprojectname and whenever I want to use a library I plop it in my code as an import and use it, and then go mod tidy will automatically add it to the go.mod file