I try to create a mock of a file with an interface imported from another file. I have try with `aux_files` and `imports` but I did non succeed to have a correc
My library is github.com/influxdata/influxdb1-client/v2,and I need to use it to operate the VictoriaMetrics, For example, I need to make the following qu
I'm using the Apache Beam Go SDK and having a hard time getting a PCollection in the correct format for grouping/combining by key. I have multiple records per k
I want to use GoMock to test some code, without coupling my tests too tightly to the actual implementation of the thing under test. But GoMock seems to require
Below is the signature of the WithValue func. func WithValue(parent Context, key, val interface{}) Context I took a look at Go official documentation but they
I've written a simple function in Go (1.18.1), which takes any (a.k. interface{}) type as input and returns the value as string, in case of a nil pointer, the f
I am trying to generate a label with a multiline address.... the docs say the occurrence of AddressLine can appear three times. however this is invalid json and
Is there any way to make goroutine execute one after another ( one by one) if it was the same function? I didn't mean to use goroutine firstly. However, "os/exe
I'm having issue in saving a PDF file in SQL Server database using stored procedure in Golang. Below is the code. tsql := fmt.Sprintf("DECLARE @tmp varbinary(ma
I have the following code with two repositories that have the same functionality but different return types. I want to call the findAll method
How to log the line number and file name of the error? I tried %w, zap logger's Errorw, but its not working as good as github.com/pkg/errors, which is sadly arc
I have a custom handler written in Go running as an Azure Function. It has an endpoint with two methods: POST /entities PUT /entities It was easy to make my ap
i have gone through some naked return/named returns(here) and similar question here but still have some doubts in my understanding on naked return. Below is cod
I use redigo to use redis in golang I have tried to use group with reducerTOLIST but I got the following error: Error parsing Aggregate Reply: redigo: unexpect
Now, the following code does what it's supposed to do, load calc.exe to memory and execute it, it does that fine. I've stitched together this code to show Creat
Using package github.com/abema/go-mp4 when i try to run the example in the docs i get following error: invalid operation: box (variable of type *mp4.BoxInfo) is
definition of linked list: type ListNode struct { Val int Next *ListNode } insert helper that does the pointer manipulation: I am aware that root.Val
I have an application which needs to read files from two different path. After reading all these files, I need to load them up in memory in products map. Path:
So I want to develop multiple flavors of log one for generic use and other for performing a specific operation I want to separate those logs by storing them in
The generics proposal has a section on how to return the zero value of a type parameter, but it does not mention how to check if a value of a parametrized type