Category "go"

Heroku Go app crashes, version `GLIBC_2.32' not found, required by bin/main

So I have a very simple web app that just serves an html file right now, and my code works on my laptop, but not on heroku's servers. There are no errors while

Trouble with go get install for mcumgr

I am trying to install MCUMgr on MACos. Here is a link for mcumgr: https://docs.zephyrproject.org/latest/services/device_mgmt/mcumgr.html I install the Go Progr

How to get html element inside script

using go-colly how to get element inside script tag? ie: <script language="Javascript">jQuery( document ).ready(function() {jQuery("#table-hold").html('&l

Deadlock in book <The Go Programming Language>, how it would happen and why it happen?

There are several times in this book talk about deadlock regarding to incorrect usage of goroutine and channel, and I failed to grasp why the deadlock happen. F

Getting different output for slight variation in input for unicode.IsNumber() function in Go

Why does unicode.IsNumber(rune(truncfloat)) returns false some cases? For 55.3 output is true For 58.3 output is false Below is my code: package main import (

How to get parameters in cloudformation template to launch using Amazon Go SDK?

I am having trouble writing a script in Golang to launch a cloudformation template that has several parameters. I am new to both sdk and golang, so I am runnin

Can't connect to Go Server in Docker container

I am trying to run a an HTTP Server written in Golang inside of a docker container and I keep getting connection refused. Everything is being run inside of an U

SetCookie() couldn't set dot prefix for domain

package main import ( "time" "github.com/gin-gonic/gin" ) func main() { r := gin.Default() r.GET("/ping", func(c *gin.Context) { c.Se

How to see Go func len() Implementation in VS Code?

My goal is to see the logic behind func len() in Golang. I use VS Code for IDE. The problem is when I tried to do Go to Implementation, it returns No implementa

Unmarshal remaining JSON after performing custom unmarshalling

I have a JSON object That contains an implementation of an interface within it. I'm attempting to take that JSON and marshal it into a struct whilst creating th

In Go gin framework , how to get all url that I have registered in the router

I’m programming the role based access control with casbin. However ,the police need me to provide urls that the role has. The “v1” column in t

Add headers for each HTTP request using client

I know that I can add headers to each HTTP request manually using cli := &http.Client{} req, err := http.NewRequest("GET", "https://myhost", nil) req.Heade

Implicit memory aliasing in for loop

I'm using golangci-lint and I'm getting an error on the following code: versions []ObjectDescription ... (populate versions) ... for i, v := range versions {

How to create structs in Golang from other partial structs?

If I have a two different structs, that mostly overlap each other in regards to their property types, and I need to create one from the other, is there some mor

Cadence Long Running Child Workflows

For long running activities we can use heartbeats to notify whether the activity is running or dead. We have a workflow that invokes multiple child workflow w

Go rest api using GIN Framework returning status code 400

I am trying to write a rest endpoint using gin which should return status 200. I have coded it as well in the same way, but am getting status 400. My code is as

Dynamic prometheus labels in Gauge

I wonder if/how it's possible to add dynamic labels. I don't know the key or the quantity of the labels which I would like to add to my gauge values. What I tr

Getting Go to recognize when new line is added to a TOML config file

I am trying to create a simple cli tool in Go using a TOML config file. I want to be able to store frequent commands I use on the command line for other tools,

How to print UTF-8 (or unicode) characters in Go (golang) on Windows

Let's have a look at this: ✓ Hello, 世界 As you can see there is a unicode checkmark and chinese/japanese characters. In go, If I use MSYS

How to get route inside middleware go-chi

To check authorization i need to know the route inside the authorization middleware. I checked docs from go-chi and did it that way: func Authenticator(next htt