Questions tagged [go-packages]
45 questions
203
votes
3 answers
Can I list all standard Go packages?
Is there a way in Go to list all the standard/built-in packages (i.e., the packages which come installed with a Go installation)?
I have a list of packages and I want to figure out which packages are standard.

Alok Kumar Singh
- 2,331
- 3
- 18
- 37
67
votes
16 answers
VSCode: Could not import Golang package
I'm writing a Go project inside my GoPath, and i'm using the Redigo package for connecting to a Redis Server. The application runs fine, however in VSCode there is this annoying error on package import, which is preventing VSCode from giving…

Jimi
- 1,605
- 1
- 16
- 33
64
votes
2 answers
Organize local code in packages using Go modules
I can not find a way to factor out some code from main.go into a local package when using Go modules (go version >= 1.11) outside of $GOPATH.
I am not importing any external dependencies that need to be included into go.mod, I am just trying to…

TPPZ
- 4,447
- 10
- 61
- 106
6
votes
2 answers
Manage local/private Golang packages and modules for docker builds
I'm pretty new to golang and docker so after looking around in many threads and internet resources I ended up confused about how I should set things up.
My problem is that I'm facing a docker build error of a golang app because of a not found local…

R.E.B Hernandez
- 147
- 2
- 9
5
votes
1 answer
Kubernetes client go couldn't find module
I'm trying to connect to my local Kubernetes cluster hosted on minikube, here's the code for the same, now when I do go run minikube.go, it gives me an error…

Rajat Singh
- 653
- 6
- 15
- 29
4
votes
1 answer
Publishing a golang module: Semantic versioning
I've been trying to create and publish a golang SDK for my web application: https://datelist.io
Everything works well on my local setup. However, things are started to get more difficult once I'd like to publish my SDK to the https://pkg.go.dev/…

Alexis Clarembeau
- 2,776
- 14
- 27
3
votes
2 answers
How do I delete a package that I accidentally published to go.dev?
I accidentally published a package to go.dev website, can anyone tell me how to delete it?
https://pkg.go.dev/github.com/Nksama/Random-quotes

Yato
- 103
- 1
- 11
3
votes
2 answers
Golang Module problem--package xxx/xxxx is not in GOROOT
so here is what my directory is:
go
|-src
|-ppppppSample
|-newFolderOne
|-firstSample.go
|-hello.go
|-go.mod
and here is the content of hello.go
package main
import (
"fmt"
jjj…

Eien_Zheng YC_
- 55
- 2
- 5
3
votes
1 answer
Go get error while getting major version module dependency
I have an executable go module and i am trying to execute the below command
go get github.com/saipraveen-a/number-manipulation/v2
and get this error:
module github.com/saipraveen-a/number-manipulation@upgrade found (v1.0.1), but does not contain…

java_geek
- 17,585
- 30
- 91
- 113
2
votes
2 answers
Issue with developing a multi-module Go workspace
My folder structure looks something like this... (say my git repo name is demorepo)
demorepo
|--directory1
|-- (no go.mod at this level)
|--module1
|--package1 --------->--------------->--------------------->----|
|--go.mod…

Keval Bhogayata
- 4,422
- 3
- 13
- 36
2
votes
1 answer
How to properly download and install packages in Go?
I have no clue what I'm doing wrong, I look up steps online what to do and they all tell me to just go to CMD, type in go get ___ and then just import the github link into my file but I constantly get the could not import error in VS Code.
I am…

SnowyCDN
- 191
- 1
- 1
- 6
1
vote
0 answers
How can you use go doc without modules?
Is it possible to use go doc for a 'downloaded' package without creation of a module?
~/tt$ ls # empty
~/tt$ go install go.mongodb.org/mongo-driver/bson@latest
package go.mongodb.org/mongo-driver/bson is not a main package
~/tt$ go doc…

Ronald Petty
- 75
- 6
1
vote
3 answers
cannot find package google.golang.org/grpc
When I try to import the grpc package I get the following error:
could not import google.golang.org/grpc (cannot find package "google.golang.org/grpc" in any of
/usr/local/go/src/google.golang.org/grpc (from $GOROOT)
…

Ansh Malik
- 162
- 2
- 7
1
vote
1 answer
Copy go package from previous stage based go image?
In image based Python, I want to run one command (*) using go package gnostic:
RUN gnostic --grpc-out=test test/openapi/loyalty-bff.yaml
I did wrote following dockerfile:
FROM golang:1.17 AS golang
RUN go get -u github.com/google/gnostic@latest
RUN…

chicken dev
- 23
- 5
1
vote
1 answer
What causes package samplerate not being found in the pkg-config search path?
I stumbled upon a problem when I was trying to install gosamplerate for my project. I was following installation manual on the repository https://github.com/dh1tw/gosamplerate but after succesfully installing libsamplerate0, I get error response…

camilos
- 11
- 5