Category "go"

Extend golang struct/type from another package

I have done some reading and found similar threads but none seem to work for my use case. I am trying to extend mongo's primitive library specifically primitive

When Cloudwatch Logs data is sent into kinesis data stream, what is its encoding format

I'm trying to write a Go program, to download data from aws kinesis data stream. I read that kinesis data stream encode the data with base64, so I need first de

Parallel traveling salesman problem solver finishes prematurely

Good time of the day. I'm doing an assignment which involves writing a program that solves Traveling Salesman Problem in parallel using brute-force method. I ma

Cosmwasm environment setup error: "first path segment in URL cannot contain colon"

I'm trying to go through the Cosmwasm docs and I'm stuck on the "Setting Up Environment" step. I'm on Ubuntu so when I put the parameters under #bash in my .bas

How to solve "interface method must have no type parameters"?

I'm trying out go generics in 1.18beta2 and I'm trying to write an abstraction layer for key/value store, boltdb. This is what I'm trying to achieve with it. ty

Is it possible to create package outside of GOROOT or GOPATH? [duplicate]

My goal is to create a Go's project folder on Desktop /Users/username/Desktop/Learn/golang-package and create a math package. Reference: https

module lookup disabled by GOPROXY=off, but go env shows GOPROXY is set

When trying to lookup some modules, I am having an issue from VS Code where the error pictured below indicates that my GOPROXY is set to off, but when I run go

CORS problem,using axios,how can this be possible?

I'm using gin to be my backend,and this is my cors middleware code. func Cors() gin.HandlerFunc { return func(ctx *gin.Context) { method := ctx.Requ

Is there a way to display a field of a map[key-string] with value-struct, in html, in golang? [closed]

I have a datatype of map[key-string] value-struct, and I'm trying to display a field(Timing) of the struct I tried all sort of variations for

Load data from reading files during startup and then process new files and clear old state from the map

I am working on a project where during startup I need to read certain files and store it in memory in a map and then periodically look for new files if there ar

How to download private repo from Dockerfile with bitbucket and golang project

I want download a private repository from bitbucket, but get some error fatal: could not read Username for 'https://bitbucket.org': terminal prompts disabled h

cloud build pass secret env to dockerfile

I am using google cloud build to build a docker image and deploy in cloud run. The module has dependencies on Github that are private. In the cloudbuild.yaml fi

Amazon SQS:: Got an error while trying to create queue: NoCredentialProviders: no valid providers in chain. Deprecated

I am trying to create Amazon SQS from my local machine and facing errors like Got an error while trying to create queue: NoCredentialProviders: no valid provide

Retrieval after serialization to disk using gob

I have been learning about databases and wanted to implement one as well for learning purposes and not for production. I have a defined schema: type Row struct

Go generics: invalid composite literal type T

package main import ( "google.golang.org/protobuf/proto" ) type NetMessage struct { Data []byte } type Route struct { } type AbstractParse interface

cannot infer V: infer type parameter from constraint implementation

I have an interface in go which wants to support saving and loading results in different databases and I want to support different types. package cfgStorage ty

Go create a mock for gcp compute sdk

I use the following function, and I need to raise the coverage of it (if possible to 100%), the problem is that typically I use interface to handle such cases i

How to configure Windows to allow Golang app to trust CA of self-signed cert

I have a 3rd party development tool that was written in Golang. My company uses Netskope which injects self-signed certificates in any SSL traffic from my machi

protoc --go_opt=paths=source_relative vs --go-grpc_opt=paths=source_relative

I am having a hard time figuring out protoc command and go plugin. What is the different between: protoc \ # Directory where you want the compiler to write y

Re-slicing slices in Golang

I recently picked up the Go language, and now I am confused with the following code: package main import "fmt" func main() { a := make([]int, 5) prin