Category "go"

Golang loop through video frames and pixels?

Is it possible in Golang to loop through an .mp4/.mov video file frame by and modify each frame's pixels? I know this is a complicated answer and there are bet

Issue with connections pool on mysql

I'm having some issues with the api I'm developing: sometimes (yes, not always) when I make a request to the golang server from my angular app, it gaves me this

What's the difference between bufio.NewReader(os.Stdin) and fmt.Scanln() in Golang [closed]

package main import ( "bufio" "fmt" "os" ) func main() { in := bufio.NewReader(os.Stdin) fmt.Println("Please input S: ")

simple planetscale - golang app won't select the database properly

After connecting to a Planetscale database using DSN with the following structure: user:password@tcp(host)/database?tls=true I decided to test it by running a

How to use the go-mysql-driver with ssl on aws with a mysql rds instance

I have a RDS instance running on AWS and I want to know how to connect to that instance over ssl. From this link Using SSL with mysql database. AWS sets up our

Change Content-Type header in Gin middleware

I have a custom gin middleware set up to handle errors but however, it does change to the Content-Type header. package middleware import ( "fmt" "net/

Apache Pulsar: Error Checking/Getting Partition Metadata while Subscribing

I'm trying to subscribe to an Apache Pulsar topic, and I know for certain the tenant, namespace, and topic all exist because other consumers are able to subscri

What is the Big O notation for string.Contains() in GoLang?

strings.Contains(str, substr) N = len(str) M = len(substr) Is Average case = O(N/2 + M) Worst case = O(N - M)?

Go To Definition (Ctrl + Click) in VS Code v1.45.1 with Go v1.14.1 and Ubuntu 20.04 not working

I tried everything mentioned in below ling https://github.com/microsoft/vscode-go/issues/3072 I updated godef as suggested and installed gopls, but nothing wo

Go Modules vs Package

just starting to learn about Go Modules. I have a question on importing local packages inside the same module. The example I am looking at is this repo: https:

protoc-gen-go: unable to determine Go import path for "simple.proto"

I have simple proto file with following content. syntax="proto3"; package main; message Person { string name = 1; int32 age = 2; } I am trying t

how can I validate and process html form (taking in inpute from the ui login interface) using fiber framework golang programming language

please help me to take input with fiber golang framework <form action="/" method="POST" novalidate> <div> <p><label>Your ema

Unmarshal to custom interface

The usual approach for unmarshalling is like this: atmosphereMap := make(map[string]interface{}) err := json.Unmarshal(bytes, &atmosphereMap) But how to

How to verify JWT signature with JWK in Go?

I have been searching for an example I can understand of how to validate the signature of a JWT with the Go Language. This might be especially tricky since I am

Performance of Nats Jetstream

I'm trying to understand how Nats Jetstream scales and have a couple of questions. How efficient is subscribing by subject to historic messages? For example le

How can I cast []byte to [8]uint8

I need to populate a struct that has a member of type [8]uint8. This needs be populated with a byte array of type []byte initialized to length 8. The simplistic

How to Trim "[" char from a string in Golang

Probably a silly thing but got stuck on it for a bit... Can't trim a "[" char from a string, things I tried with outputs: package main import ( "fmt"

grpc.WithInsecure is deprecated: use insecure.NewCredentials() instead

Hey I'm trying make a small test client with Go and Grpc, opts := grpc.WithInsecure() cc, err := grpc.Dial("localhost:9950", opts) if err != nil {

Adding hours, minutes, seconds to current time

How do I add hours, minutes, and seconds (defined as ints) to the current time, similar to AddDate? timein := time.Now().Local().AddDate(Hours, Mins, Sec) bu

Golang build error 0x80000034 (2147483700)

command I ran: go build -o main output: /usr/local/go/pkg/tool/darwin_arm64/link: /usr/local/go/pkg/tool/darwin_arm64/link: combining dwarf failed: unknown load