AzureAD / microsoft-authentication-library-for-go

The MSAL library for Go is part of the Microsoft identity platform for developers (formerly named Azure AD) v2.0. It enables you to acquire security tokens to call protected APIs. It uses industry standard OAuth2 and OpenID Connect.
MIT License
218 stars 87 forks source link

[Bug] 'go get' in no longer supported outside a module error #489

Open juhlee-microsoft opened 4 weeks ago

juhlee-microsoft commented 4 weeks ago

Which version of MSAL Go are you using? latest.

Where is the issue? I am relatively new to Go language environment and try to follow this README steps. This is a part of my new project in Go. I am getting below error with 'go get' command. Google search did not show any helpful contents. The file 'go.mod' exists in the path. Where does this error come from? The 'go install' also failed with another error. I'd like to understand this error meaning.

ju-hyounglee@Ju-Hyoungs-MacBook-Air Documents % go get -u github.com/AzureAD/microsoft-authentication-library-for-go/
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'. ju-hyounglee@Ju-Hyoungs-MacBook-Air Documents %

Is this a new or an existing app? N/A

What version of Go are you using (go version)? go version go1.21.6 darwin/arm64

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
ju-hyounglee@Ju-Hyoungs-MacBook-Air Documents % go env
GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/ju-hyounglee/Library/Caches/go-build'
GOENV='/Users/ju-hyounglee/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/ju-hyounglee/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/ju-hyounglee/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.6'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/pd/dfs8k70d5gzdcpjx95wnghy00000gn/T/go-build2391299166=/tmp/go-build -gno-record-gcc-switches -fno-common'
ju-hyounglee@Ju-Hyoungs-MacBook-Air Documents %

**Repro**

**Expected behavior**
getting microsoft-authentication-library-for-go repo

**Actual behavior**
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'.

**Possible solution**

**Additional context / logs / screenshots**
Add any other context about the problem here, such as logs and screenshots.