2fa icon indicating copy to clipboard operation
2fa copied to clipboard

Installing issue with newer go version

Open prashant3286 opened this issue 3 years ago • 2 comments

Just a suggestion from my side:

Starting in Go 1.17, installing executables with go get is deprecated. Now, go install may be used instead.

So can you please just update the documentation so that people would not be confused while using it

prashant3286 avatar Jun 14 '22 17:06 prashant3286

I don't know go. What's the right way to install and proceed?

Thank you.

c:\go>go install rsc.io/2fa@latest
go: downloading rsc.io/2fa v1.2.0
go: downloading github.com/atotto/clipboard v0.1.2
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:65:2: package bufio is not in GOROOT (c:\go\src\bufio)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:66:2: package bytes is not in GOROOT (c:\go\src\bytes)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:67:2: package crypto/hmac is not in GOROOT (c:\go\src\crypto\hmac)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:68:2: package crypto/sha1 is not in GOROOT (c:\go\src\crypto\sha1)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:69:2: package encoding/base32 is not in GOROOT (c:\go\src\encoding\base32)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:70:2: package encoding/binary is not in GOROOT (c:\go\src\encoding\binary)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:71:2: package flag is not in GOROOT (c:\go\src\flag)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:72:2: package fmt is not in GOROOT (c:\go\src\fmt)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:73:2: package io/ioutil is not in GOROOT (c:\go\src\io\ioutil)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:74:2: package log is not in GOROOT (c:\go\src\log)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:75:2: package os is not in GOROOT (c:\go\src\os)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:76:2: package path/filepath is not in GOROOT (c:\go\src\path\filepath)
package rsc.io/2fa: cannot find package
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:77:2: package sort is not in GOROOT (c:\go\src\sort)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:78:2: package strconv is not in GOROOT (c:\go\src\strconv)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:79:2: package strings is not in GOROOT (c:\go\src\strings)
C:\Users\joe\go\pkg\mod\github.com\atotto\[email protected]\clipboard_windows.go:10:2: package syscall is not in GOROOT (c:\go\src\syscall)
C:\Users\joe\go\pkg\mod\github.com\atotto\[email protected]\clipboard_windows.go:11:2: package time is not in GOROOT (c:\go\src\time)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:81:2: package unicode is not in GOROOT (c:\go\src\unicode)
C:\Users\joe\go\pkg\mod\github.com\atotto\[email protected]\clipboard_windows.go:12:2: package unsafe is not in GOROOT (c:\go\src\unsafe)

c:\go>2fa -add twitter
'2fa' is not recognized as an internal or external command,operable program or batch file.

Shohreh avatar Jul 03 '23 21:07 Shohreh

I don't know go. What's the right way to install and proceed?

Thank you.

c:\go>go install rsc.io/2fa@latest
go: downloading rsc.io/2fa v1.2.0
go: downloading github.com/atotto/clipboard v0.1.2
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:65:2: package bufio is not in GOROOT (c:\go\src\bufio)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:66:2: package bytes is not in GOROOT (c:\go\src\bytes)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:67:2: package crypto/hmac is not in GOROOT (c:\go\src\crypto\hmac)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:68:2: package crypto/sha1 is not in GOROOT (c:\go\src\crypto\sha1)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:69:2: package encoding/base32 is not in GOROOT (c:\go\src\encoding\base32)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:70:2: package encoding/binary is not in GOROOT (c:\go\src\encoding\binary)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:71:2: package flag is not in GOROOT (c:\go\src\flag)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:72:2: package fmt is not in GOROOT (c:\go\src\fmt)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:73:2: package io/ioutil is not in GOROOT (c:\go\src\io\ioutil)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:74:2: package log is not in GOROOT (c:\go\src\log)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:75:2: package os is not in GOROOT (c:\go\src\os)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:76:2: package path/filepath is not in GOROOT (c:\go\src\path\filepath)
package rsc.io/2fa: cannot find package
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:77:2: package sort is not in GOROOT (c:\go\src\sort)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:78:2: package strconv is not in GOROOT (c:\go\src\strconv)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:79:2: package strings is not in GOROOT (c:\go\src\strings)
C:\Users\joe\go\pkg\mod\github.com\atotto\[email protected]\clipboard_windows.go:10:2: package syscall is not in GOROOT (c:\go\src\syscall)
C:\Users\joe\go\pkg\mod\github.com\atotto\[email protected]\clipboard_windows.go:11:2: package time is not in GOROOT (c:\go\src\time)
C:\Users\joe\go\pkg\mod\rsc.io\[email protected]\main.go:81:2: package unicode is not in GOROOT (c:\go\src\unicode)
C:\Users\joe\go\pkg\mod\github.com\atotto\[email protected]\clipboard_windows.go:12:2: package unsafe is not in GOROOT (c:\go\src\unsafe)

c:\go>2fa -add twitter
'2fa' is not recognized as an internal or external command,operable program or batch file.

Hey this is a bit late and I sort of got into the same confusion after installing go using snap. There is a directory at ~/go, and inside ~/go/bin you would see the binary file of 2fa, running ./2fa in the directory ~/go/bin works. I guess to call "2fa" directly in the terminal you would add ~/go/bin/2fa to the local path?

ghost avatar Sep 25 '23 19:09 ghost