Questions tagged [go-packages]

45 questions
1
vote
1 answer

Golang compiling in a linux machine not connected to the internet

We have a CI/CD server that is not connected to the Internet due to company policy. I want to run Unit Tests in this server. I am allowed to WinScp files to it. To get it working, I thought I will FTP all the files from my source Windows machine…
Doyyan
  • 125
  • 1
  • 9
1
vote
1 answer

Issue with go package declaration containing more than 2 words separated by underscore

everyone, I'm confused by what I'm seeing; I have the following tree: ├── go.mod ├── main.go └── server ├── server.go └── server_integration_test.go Let's say my module name (mod.go) is gotest. Content of server.go: package server type…
Farzad
  • 1,770
  • 4
  • 26
  • 48
1
vote
1 answer

How to check-in packages when using Go modules?

We currently are using govendor to manage packages in our go repository. Since we are using a lot of packages, we have decided to check-in the packages sources code into vendor folder, so that: Saving time downloading all packages every time the…
green-i
  • 315
  • 2
  • 16
0
votes
0 answers

Embedding a static YAML file in a binary using Go 1.15

I am reading some data from a YAML file inside my go code: func main() { yamlFile, err := ioutil.ReadFile("data.yaml") if err != nil { fmt.Println("Failed to open grid map file with err: ", err.Error()) return // ... do something with…
MRA1412
  • 57
  • 8
0
votes
0 answers

package event-service/internal/form is not in GOROOT

I am trying to run go test -v -cover -race -tags=integration_tests ./... but it gives me the following error: package event-service/internal/form is not in GOROOT GOPATH="/home/user/go" GOROOT="/usr/local/go" GO Version: go1.17.5 linux/amd64
user17362082
0
votes
0 answers

VSCode and Golang packages and intellisence misbehaving

I have installed Golang on my Mac with Brew. So it's the latest and greatest. VS Code is up to date. I have installed the most recent Go extensions and ALL of the tools from the command palette. All this seems to work. However, when I try to…
Gabe
  • 49,577
  • 28
  • 142
  • 181
0
votes
1 answer

Find checksum of every dependency in golang

I want to be able to get the checksum of every package used by a go program, including packages used within modules. runtime/debug in the standard library has ReadBuildInfo(), which is great, but it only gives data for modules, not for…
0
votes
0 answers

Get structs in a package for go-gorm migrations

There is a way to get all structs in package (entity in this case) to generate an automatic migrations list? I split entities and migration package and now we have a package dedicated to all entities used by gorm and this is how I manage migration…
0
votes
1 answer

select query using in go language- MYSQL

I am trying to fetch full table details using go language , but not getting func GetallUserHandler(c *gin.Context) { // fetch data userdata, selectErr := views.GetallUser() if selectErr != nil { …
Mia Mia
  • 143
  • 12
0
votes
2 answers

The package could not be imported after you installed it using Go Get ?

I turned on GO111MODULE=on, and when using the Go Get -u installation package, it will be installed to the PGK directory, but I can't use it after installation Go version go1.15.6 Windows/amd64 go.mod file module github.com/xanzy/go-gitlab go…
gujiwork
  • 65
  • 7
0
votes
1 answer

Is there a way to send strings as keystrokes like autohotkey?

I moved from Windows to Linux and want to use AutoHotKey. I've tried using autokey but I really didn't like it. Is it possible to use golang to simply send strings as keystrokes to other programs?
Rain
  • 37
  • 6
0
votes
1 answer

Why is my Golang package function not recognized by my test?

I have a directory outside of my GOPATH (I'm working on understanding Go modules; this is not yet a module, just a step along the way). The directory path is ~/Development/golang/understanding-modules/hello. The tree looks like: hello/ (package…
skillit zimberg
  • 1,024
  • 1
  • 14
  • 22
0
votes
1 answer

How to know why a specific package version is being set in go.mod?

I have a Go repository with a go.mod currently requiring k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible. I would like to bump the version of k8s.io/client-go used by my module but, when I change the version to be v0.19.1 (which…
Armand Grillet
  • 3,229
  • 5
  • 30
  • 60
0
votes
0 answers

use of internal package xxx not allowed after rename the project

I am trying to start my first Go project based on someone else's code, so I download his GitHub repo as zip, upload it to my own repo. Then use go get -u github.com/@username/@repo to install my repo, and add a replace statement to go.mod: replace…
Jiahao Cai
  • 1,222
  • 1
  • 11
  • 25
0
votes
1 answer

Originating proxy of downloaded module

Say you are using Go 1.13 and set up a project initialized for Go Modules. $ mkdir my-project $ cd my-project $ git mod init github.com/bmuschko/my-project Instead of using the default Google proxy to download dependencies, you set GoCenter or a…
Benjamin Muschko
  • 32,442
  • 9
  • 61
  • 82