Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error when I execute go get github.com/mattn/memo #32

Closed
yyYank opened this issue Nov 29, 2019 · 10 comments · Fixed by #33
Closed

Installation error when I execute go get github.com/mattn/memo #32

yyYank opened this issue Nov 29, 2019 · 10 comments · Fixed by #33

Comments

@yyYank
Copy link

yyYank commented Nov 29, 2019

OS

macOS

Go version

go version go1.13.4 darwin/amd64

errror log

go get -u github.com/mattn/memo
# github.com/mattn/memo
/Users/yy_yank/go/src/github.com/mattn/memo/main.go:108:16: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
        cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/yy_yank/go/src/github.com/mattn/memo/main.go:112:18: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
        cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/yy_yank/go/src/github.com/mattn/memo/main.go:148:16: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
        cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/yy_yank/go/src/github.com/mattn/memo/main.go:160:18: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
        cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
/Users/yy_yank/go/src/github.com/mattn/memo/main.go:295:15: cannot use commands (type []cli.Command) as type []*cli.Command in assignment

Similar issue?

swaggo/swag#556

I tried to fix.
It seems to solve when modify dependency in Gopkg.toml.

OK:

[[constraint]]
  name = "github.com/urfave/cli"
-  version = "1.20.0"
+  version = "1.22.1"

NG:

[[constraint]]
  name = "github.com/urfave/cli"
-  version = "1.20.0"
+  version = "1.22.2"
mattn added a commit that referenced this issue Nov 29, 2019
@mattn mattn mentioned this issue Nov 29, 2019
@mattn mattn closed this as completed in #33 Nov 29, 2019
@vaaaaanquish
Copy link

@mattn Hi.

I got the same problem.

  • OS: macOS
  • Version: go version > go version go1.13.5 darwin/amd64
  • error log
$ go get -u github.com/mattn/memo
# github.com/mattn/memo
go/src/github.com/mattn/memo/main.go:108:16: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/mattn/memo/main.go:112:18: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/mattn/memo/main.go:148:16: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in array or slice literal:
	cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/mattn/memo/main.go:160:18: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in array or slice literal:
	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
go/src/github.com/mattn/memo/main.go:295:15: cannot use commands (type []cli.Command) as type []*cli.Command in assignment

Thanks.

@mattn
Copy link
Owner

mattn commented Dec 19, 2019

This is caused by drastic changes by github.com/urfave/cli. Could you please try

$ GO111MODULE=on go get -u github.com/mattn/memo

Or

$ go get -u github.com/urfave/cli
$ go get -u github.com/mattn/memo

@vaaaaanquish
Copy link

Thank you for response, and It moved. I'm going to be happy now :)

@squeuei
Copy link
Contributor

squeuei commented Dec 20, 2019

Unfortunately, it didn't work on my environment.

OS and Go version

  • OS: Debian GNU/Linux 10 (buster)
  • Version: go version go1.11.6 linux/amd64
$  mkdir tmp && cd tmp && go mod init tmp && go get -u github.com/mattn/memo

Result

...
# github.com/shurcooL/github_flavored_markdown
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:71:7: const initializer blackfriday.EXTENSION_NO_INTRA_EMPHASIS | blackfriday.EXTENSION_TABLES | blackfriday.EXTENSION_FENCED_CODE | blackfriday.EXTENSION_AUTOLINK | blackfriday.EXTENSION_STRIKETHROUGH | blackfriday.EXTENSION_SPACE_HEADERS | blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK is not a constant
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:71:20: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:72:2: undefined: blackfriday.EXTENSION_TABLES
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:73:2: undefined: blackfriday.EXTENSION_FENCED_CODE
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:74:2: undefined: blackfriday.EXTENSION_AUTOLINK
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:75:2: undefined: blackfriday.EXTENSION_STRIKETHROUGH
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:76:2: undefined: blackfriday.EXTENSION_SPACE_HEADERS
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:77:2: undefined: blackfriday.EXTENSION_NO_EMPTY_LINE_BEFORE_BLOCK
../../.go/pkg/mod/github.com/shurcoo!l/[email protected]/main.go:93:2: undefined: blackfriday.Html

@mattn
Copy link
Owner

mattn commented Dec 20, 2019

Please set GO111MODULE=on

@squeuei
Copy link
Contributor

squeuei commented Dec 20, 2019

Thank you for reply.

No luck. Since it's a new computer, I deleted what are in $GOPATH and tmp directory which I made to go mod init. And then, I tried

GO111MODULE=on go get -u github.com/mattn/memo

(in newly made tmp directory with go mod init tmp)

It produced the same result.

@mattn
Copy link
Owner

mattn commented Dec 20, 2019

I don't reproduce on Go tip.

@squeuei
Copy link
Contributor

squeuei commented Dec 20, 2019

Hmm... that's strange. Now I've tried on another computer / linux distribution.

  • OS: Fedora 31
  • Go version: go version go1.13.5 linux/amd64

GO111MODULE=on go get -u github.com/mattn/memo

It was stopped at shurcoo!l/github_flavored_markdown too.

I'm an alien in Go ecosystem, so let me confirm. After the installation of golang from distribution's package manager, I set $GOPATH only and everything else is default. Is there anything I have to configure?

@mattn
Copy link
Owner

mattn commented Dec 20, 2019

Probably it is related to shurcooL/markdownfmt#47

@squeuei
Copy link
Contributor

squeuei commented Dec 21, 2019

Hi. I somehow found the way while it's quite dirty.

$ go get github.com/mattn/memo
$ GO111MODULE=on go get github.com/matn/memo

Of course the latter has to be executed in a folder with go.mod if I'm using go1.11 .
I'm not sure why it works and it seems to be too difficult to understand. Anyway my problem is solved.

Thank you for helping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants