Category "go"

grpc with mustEmbedUnimplemented*** method

Recently, grpc-go introduced the mustEmbedUnimplemented*** method. It is used for forward compatibility. In simple terms, I am unable to understand how it is he

vscode ssh develop Go cannot stop at breakpoint when code under /home/{username}/ floder

I have the remote develop problem. I want to ask for some advices to solve this problem. when my code under ~/ floder, debug cannot stop at breakpoints: when

force a transitive dependency version in golang

I have a question about dependencies in golang. My application defines a go.mod like this: module my.host.com/myapp require ( ext1.com/module1 v0.0.1 ) go

A structure that cannot be imported into a structure body

initialize/config.go package initialize type DatabaseConfig struct { MysqlConfig MysqlConfig `yaml:"mysql"` RedisConfig RedisConfig `yaml:"redis"` } t

Run gofmt on vim without plugin

I want to run gofmt on save on vim without installing any plugin. This is what I have tried (inspired by https://gist.github.com/tbrisbout/a91ac3419440cde40c5f5

Golang struct to Json schema

Hi I need to infer a json schema (github.com/go-openapi/spec.Schema) from a struct : type Testcase struct { Id string `json:"id,omitempty"`

In Go, when running exec.Command with /usr/bin/script before a command, an error is thrown: /usr/bin/script: invalid option -- 'P'

I am using Go to automate IBM Aspera uploads. I would like to capture the stdout/stderr percentage progress while this happens. I am running this on an ubuntu:l

Function type cannot have type parameters

I am trying to write a sample program to try and implementing the a data structure using go generic proposed in go2. As part of this I want to define a iterator

How to configure an Azure custom handler with a timer trigger?

I'm trying to configure a new function in my Golang custom handler that uses a timer trigger. But I haven't been able to find any documentation for it. I've rev

How can go-validator check fields against their zero value?

I'm trying to use https://github.com/go-playground/validator and need to ensure that user configuration has an inner struct populated (i.e. not Zero) while stil

Docker Builds Failing when running go get

All of my docker builds are getting this error when doing a go get. Unfortunately the error message isn't very helpful (or I am struggling to understand it)...

how to build a nested, dynamic JSON in Go

I'm writing a simple API in Go that reads from a database and outputs GeoJSON. I have this working for simple points. But some of my data is lines (linestring).

Parse Content Disposition header in GO

I am trying to retrieve the filename from this http writer for testing purposes. On the server I have: func servefile(w http.ResponseWriter, r *http.Request ) {

Integrating Tus Resumable File Upload Protocol with Gin-Gonic CORS issue

I have looked at the similar questions here related to CORS issues with Gin and Tus; none addresses the problem I am currently having. The current implementatio

WebRTC MediaDevices with Golang and Pion on a Windows 10 "pkg-config error"

I try to follow this documentation https://github.com/pion/mediadevices. But somehow i constantly run into errors. First i had to install MinGW (gcc). Then i ha

Issue installing Terratest using Go Task's Yaml Azure pipeline - issue triggering terratest tests in sub-folder

I'm facing this issue while installing terratest by azure yaml pipeline : C:\hostedtoolcache\windows\go\1.17.1\x64\bin\go.exe install -v github.com/gruntwork-io

Scraping a simple website with colly in golang does not return any data

I'm trying to scrape a simple website that looks like this: <html> <head> </head> <body> <pre> "Name Surname 1 Name Su

Is there a way to convert handlebars syntax to the golang template language?

Is there a safe way to easily convert standard handlebars templating syntax to the templating syntax used in golang(e.g. {{.Lookup "Question"}})? I have a Jenki

CRC32 Checksum Calculation via GO

Trying to create a GO function that produces the same result as the Ubuntu Linux "cksum" operation, for example: $ echo 123 > /tmp/foo $ cksum /tmp/foo 23306

Go 1.18 build error on Mac: "unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable"

I upgraded to Go 1.18 on Mac 12+. 'go build' fails with errors like: # golang.org/x/sys/unix ../../gopath/pkg/mod/golang.org/x/[email protected]