#435·martini

package github.com/go-martini/martini is not a main package

Author: stlechoCreated Mar 19, 2025Updated Mar 19, 2025

After installing Go v1.24.1, It seems that the 'go get' command is no longer supported. When using 'go install' I get the following error: "package github.com/go-martini/martini is not a main package". As a result, when I use 'go run', I get this: "server.go:3:8: no required module provides package github.com/go-martini/martini: go.mod file not found in current directory or any parent directory"

C:\Projects\go-martini>go version
go version go1.24.1 windows/amd64
C:\Projects\go-martini>go get github.com/go-martini/martini
go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.
C:\Projects\go-martini>go install github.com/go-martini/martini@latest
go: finding module for package github.com/codegangsta/inject
go: found github.com/codegangsta/inject in github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0
package github.com/go-martini/martini is not a main package
C:\Projects\go-martini>go run server.go
server.go:3:8: no required module provides package github.com/go-martini/martini: go.mod file not found in current directory or any parent directory; see 'go help modules'