Can't install gin-gonic: c.engine.AppEngine undefined (type *Engine has no field or method AppEngine) - go

I can't install gin-gonic for my golang project. I tried reinstalling go, resetting the bash files, delete and recreate the project folder, and searched the error as keyword on google, but found nothing
Here are my terminal messages:
$ go get -u github.com/gin-gonic/gin
# github.com/gin-gonic/gin
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin#v1.7.5\context.go:735:13: c.engine.AppEngine undefined (type *Engine has no field or method AppEngine)
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin#v1.7.5\gin.go:154:3: unknown field 'UseRawPath' in struct literal of type Engine
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin#v1.7.5\gin.go:156:3: unknown field 'UnescapePathValues' in struct literal of type Engine
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin#v1.7.5\gin.go:508:11: engine.UseRawPath undefined (type *Engine has no field or method UseRawPath)
..\..\..\..\go\pkg\mod\github.com\gin-gonic\gin#v1.7.5\gin.go:510:20: engine.UnescapePathValues undefined (type *Engine has no field or method UnescapePathValues)

I downgraded to v1.7.2 and everything worked well. Take a look at https://github.com/gin-gonic/gin/issues/2948

I have the same problem when using gin#v1.7.5, so I downgrade to gin#v1.7.4, and it works well

I had the same problem. but I resolve it with root on ubuntu. Similarly, It'd be good to execute with "run as administrator"

Related

go get github.com/beego/bee Error install

Using the advised install command
go get github.com/beego/bee
Results in the below error:
github.com/gadelkareem/delve/service/rpc2
go/src/github.com/gadelkareem/delve/service/rpc2/client.go:23:5: cannot use &RPCClient literal (type *RPCClient) as type service.Client in assignment:
*RPCClient does not implement service.Client (wrong type for ExamineMemory method)
go/src/github.com/gadelkareem/delve/service/rpc2/server.go:96:52: not enough arguments in call to s.debugger.Restart
Does anyone have an idea on how to solve this?
Refer from this issue, export export GO111MODULE=on before go get.

chromedp fails to start a new instance of chrome

Hey guys I have been trying to automate a task on my browser's machine using chromedp.
I tried examples on the repo however they always fail:
unexpected fault address 0x7f7a36461000 fatal error: fault [signal SIGBUS: bus error code=0x2 addr=0x7f7a36461000 pc=0x53a9d5]
Example's source code am running can be found here.
As I understand chromedp comes with headless pre-compiled version of chrome. I have browsed the API documentation to see if it possible to pass a port on which the dev tools is listening, no success.
However when I tried mafredri/cdp it worked. I came to understand that chromedp is failing to start its embedded chrome. Although, I am not really sure. Why is this happening?
My env:
Google Chrome 85.0.4183.102
Ubuntu 18.04.4 LTS
go version go1.13.5 linux/amd64
Any help would be truly appreciated.
So, long story short I went to run tests on the chromedp locally installed library through go test, it failed. I opened an issue on the Github repo. While it was not indicated that it requires Go 1.14+ but it does.
If you encountered this issue, please proceed to first run the tests on the master branch locally installed library. If it is fails with the following log:
github.com/chromedp/chromedp [github.com/chromedp/chromedp.test]
./chromedp_test.go:862:3: t.Cleanup undefined (type *testing.T has no
field or method Cleanup) ./chromedp_test.go:948:5: t.Cleanup undefined
(type *testing.T has no field or method Cleanup)
./chromedp_test.go:950:5: t.Cleanup undefined (type *testing.T has no
field or method Cleanup) FAIL github.com/chromedp/chromedp [build
failed]
You need to know that t.Cleanup was added on Go 1.14 (credits to Oiyoo).
I hope this helps you if you are having the same problem.

sendpfast ERROR: while trying to exec [None]: argument of type 'NoneType' is not iterable

I am trying to replay a file using scapy's sendpfast function. But it throws an error.
a = rdpcap("U:\\Tests\\pcaps\\test1000.pcap")
sendpfast(a)
ERROR: while trying to exec [None]: argument of type 'NoneType' is not iterable
I am using windows 7 with scapy 2.3.3. FYI: I haven't installed TCPreplay separately. Is this because of that?
Yes, you need to install tcpreplay, as Scapy won't do that for you (and it is required to use sendpfast()).

golang error: reference to undefined identifier ‘syscall.TUNSETIFF’

So, I have been trying to build flannel (https://github.com/coreos/flannel) with gccgo. Here is the error I am getting while building:
$ ./build
Building flanneld...
# github.com/coreos/flannel/pkg/ip
gopath/src/github.com/coreos/flannel/pkg/ip/tun.go:57:37: error: reference to undefined identifier ‘syscall.TUNSETIFF’
err = ioctl(int(tun.Fd()), syscall.TUNSETIFF, uintptr(unsafe.Pointer(&ifr)))
^
I am using gccgo-5 and gcc-5. Can anyone please help me figure out what exactly is the issue here? TIA
So, I found the answer. The problem was that gccgo didn't define TUNSETIFF for my arch. I defined the value accordingly and I was able to make it work. Thanks #JimB

Can't build go project in travis

I started to create a very light weight message broker to practice go, travis and some aws services all in one project.
My current problem is that I can build, run and test my develop branch on my local machine however when travis attempts to build it I get a compile error. The code it doesn't like came straight from AWS examples to further deepen the mystery for me.
Travis failed build
https://travis-ci.org/hevnly/eevy/builds/65687886
Github repo https://github.com/hevnly/eevy/tree/92412cf729ed546d698ded1e514d2d54c340ff81
Error
handler/lambda.go:31: cannot use "github.com/awslabs/aws-sdk-go/aws".Config literal (type *"github.com/awslabs/aws-sdk-go/aws".Config) as type *"github.com/aws/aws-sdk-go/aws".Config in argument to lambda.New
handler/sqs.go:26: cannot use "github.com/awslabs/aws-sdk-go/aws".Config literal (type *"github.com/awslabs/aws-sdk-go/aws".Config) as type *"github.com/aws/aws-sdk-go/aws".Config in argument to sqs.New
Sample of code
svc := lambda.New(&aws.Config{Region: "eu-west-1"})
Ok, I have just tried to go get your repo and got the same error:
handler/lambda.go:29: cannot use "github.com/awslabs/aws-sdk-go/aws".Config literal (type *"github.com/awslabs/aws-sdk-go/aws".Config) as type *"github.com/aws/aws-sdk-go/aws".Config in argument to lambda.New
handler/sqs.go:26: cannot use "github.com/awslabs/aws-sdk-go/aws".Config literal (type *"github.com/awslabs/aws-sdk-go/aws".Config) as type *"github.com/aws/aws-sdk-go/aws".Config in argument to sqs.New
I advice you to start using a dependency manager, so you will fix your dependencies inside your repo and have reproducible builds in any place.
My recommendation is Godep, but there are others out there.

Resources