generating core failed while doing gqlgen init - go

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.

Related

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?

gotext: extract failed: pipeline: golang.org/x/text/message is not imported

I am trying to run the following command from within my template.go file:
//go:generate gotext -srclang=en update -out=catalog.go -lang=en,de_DE,es_MX,fr_CA,pt_BR
I am expected to get a catalog.go generated, but instead, I get the following error:
gotext: extract failed: pipeline: golang.org/x/text/message is not imported
template.go:3: running "gotext": exit status 1
I do have the following import in the template.go after the generate command:
import (
"time"
log "github.com/sirupsen/logrus"
"golang.org/x/text/message"
)
I've tried to move the import before the generate command. I've also tried to run generate ./... from within the root of the project. I've also tried to run gotext by itself, but it's the same error message.
I also found the following thread on github:
https://github.com/golang/go/issues/26312
I've tried what was suggested there, but it didn't seem to have solved the issue either.
I have solved the issue by running rm -rf vendor/golang.org/x/text command from the root of the project. Of course for things to work, I also needed to have gotext installed. This can be done by running go get golang.org/x/text/cmd/gotext.
I believe the issue could be solved if binaries of .../text/message are installed in the GOPATH/bin as well

How to install ginkgo and gomega using gopkg?

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.

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