How to install ginkgo and gomega using gopkg? - go

I am trying to install ginkgo and gomega using the gopkg.
It is throwing the following error:
src/gopkg.in/onsi/ginkgo.v1/ginkgo_dsl.go:24:2: use of internal package not allowed
src/gopkg.in/onsi/ginkgo.v1/ginkgo_dsl.go:25:2: use of internal package not allowed
src/gopkg.in/onsi/ginkgo.v1/ginkgo_dsl.go:26:2: use of internal package not allowed
src/gopkg.in/onsi/ginkgo.v1/ginkgo_dsl.go:27:2: use of internal package not allowed
src/gopkg.in/onsi/ginkgo.v1/ginkgo_dsl.go:28:2: use of internal package not allowed
src/gopkg.in/onsi/ginkgo.v1/ginkgo_dsl.go:29:2: use of internal package not allowed
src/gopkg.in/onsi/gomega.v1/gomega_dsl.go:21:2: use of internal package not allowed
src/gopkg.in/onsi/gomega.v1/gomega_dsl.go:22:2: use of internal package not allowed
src/gopkg.in/onsi/gomega.v1/gomega_dsl.go:23:2: use of internal package not allowed

To my understanding, this is not a fatal error. I was able to download both ginkgo and gomega using gopkg even though I got the same warning messages. A brief look at the source code shows that gomega_dsl.go and ginkgo_dsl.go import code from an internal subdirectory. I do not see why that should be a problem, though. Getting the packages worked despite these warnings.

Related

Golang following container logs undeclared name Log

I'm trying to build a container with testcontainers and output the logs to stdout.
I have followed their documentation (https://golang.testcontainers.org/features/follow_logs/) but when writing the Accept function, I get an error:
func (g *TestLogConsumer) Accept(l Log) {
g.Msgs = append(g.Msgs, string(l.Content))
}
The problem is that I didn't import a certain package, so I can't use "Log".
I get the following error:
undeclared name: Log
The question is, which package should I import. How can I make vscode import these packages automatically for me ? I have installed the go extension, but it doesn't import anything automatically.

generating core failed while doing gqlgen init

I'm attempting to follow this tutorial to set up a GraphQL server in Golang: https://www.howtographql.com/graphql-go/1-getting-started/
However, when I get to the part to run go run github.com/99designs/gqlgen init, I keep getting this error:
generating core failed: unable to load github.com/moonlightfight/elo-backend/graph/model - make sure you're using an import path to a package that exists
Not sure what I'm doing wrong...
Did run go mod init github.com/moonlightfight/elo-backend, so don't know if there's anything else I need to run that this didn't mention.

Running my revel application on windows 10 fail

I had problem when run my revel app on windows
it create fine but don't run when I try so only get this. any idea?
C:\Desarrollo\Web\webpro>revel run -a webpro
Revel executing: run a Revel application
WARN 05:53:33 harness.go:175: No http.addr specified in the app.conf listening on localhost interface only. This will not allow external access to your application
Changed detected, recompiling
Parsing packages, (may require download if not cached)... Completed
ERROR 05:53:38 build.go:406: Build errors errors="C:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\memcached.go:11:2: no required module provides package github.com/bradfitz/gomemcache/memcache; to add it:\n\tgo get github.com/bradfitz/gomemcache/memcache\nC:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\redis.go:10:2: no required module provides package github.com/garyburd/redigo/redis; to add it:\n\tgo get github.com/garyburd/redigo/redis\nC:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\inmemory.go:12:2: no required module provides package github.com/patrickmn/go-cache; to add it:\n\tgo get github.com/patrickmn/go-cache\n"
C:\Users\Mario\go\src\webpro\C:\Users\Mario\go\pkg\mod\github.com\revel\revel#v1.0.0\cache\memcached.go:11
WARN 05:53:38 build.go:420: Could not find in GO path file=C:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\memcached.go:11
ERROR 05:53:38 harness.go:239: Build detected an error error="Go Compilation Error (in C:\\Users\\Mario\\go\\pkg\\mod\\github.com\\revel\\revel#v1.0.0\\cache\\memcached.go:11:2): no required module provides package github.com/bradfitz/gomemcache/memcache; to add it:"
Error compiling code, to view error details see proxy running on http://:9000
Time to recompile 5.3684655s
I am newer ok
Best
Check your IPv4 address with the ipconfig command
Open webpro/conf/app.conf and paste the IPv4 address into the http.addr parameter

unable to get hashicorp / vault

I need to use kmac Hashicorp's Vault implementation. However, when I run the code, the following simple import:
import (
"encoding/hex"
"fmt"
"github.com/hashicorp/vault/sdk/helper/kmac"
)
throws this error: no required module provides package github.com/hashicorp/vault/sdk/helper/kmac/kmac; to add it: go get github.com/hashicorp/vault/sdk/helper/kmac/kmac
If I run:
go get github.com/hashicorp/vault/sdk/helper/kmac/kmac
I get:
go get: module github.com/hashicorp/vault/sdk#upgrade found (v0.2.0), but does not contain package github.com/hashicorp/vault/sdk/helper/kmac/kmac
I also tested to download the latest version but I get the same error. Can I get help?

Why get 'use of internal package not allowed' error when importing an internal package?

I'm running go-ethereum test codes for eth package.
When I run go test . under the eth directory, I get the following error :
eth/api.go:37:2: use of internal package not allowed
37th line of eth/api.go is as follows :
"github.com/ethereum/go-ethereum/internal/ethapi"
From what I understand, this import should not be calling the error, as this file is within go-ethereum project directory.
Running the same test command on others' machine does not produce this error, so I suspect that there is something wrong with my go settings.
What would be the problem? Appreciate your help

Resources