I am trying to call an array of objects from my JSON file but I am always facing an error saying: "cannot unmarshal array into Go value of type config ...
I am trying to call an array of objects from my JSON file but I am always facing an error saying: "cannot unmarshal array into Go value of type config ...
I am reading data from multiple tables using JOIN, CONCAT, GROUP_CONCAT, JSON_OBJECT. The data is read into the below mentioned model using gorm. T ...
I have list of array int64 values I want to use the above array in db query to filter out the records where ID is not in above ids. I tried many ...
I writing a golang program which append rule to the file as mentioned below Required format: I wrote a go program which failing to be in the above ...
Hi i am process of learning golang, and i want to ask how to create empty Object/Struct as domain model data type? i am using Fiber as my framework an ...
I am new to Go, and learning Interfaces and Structs. I am having 2 structs - ServiceSection and SliderSection and I am trying to accomplish the below ...
I have a structure that looks like this I want to be able to change the script tag for Secret into json:"secret" when a condition is satisfied. Th ...
The documentation states: Anonymous struct fields are usually marshaled as if their inner exported fields were fields in the outer struct. For ...
I am trying to use GoModifyTags but it's not giving me required result. I have installed this as per the instruction but don't know how to implement. ...
I have been using Go Validator.v2 for field validations and it works elegantly for my non-struct typed fields. However, when it comes to handling stru ...
This the struct I have defined to store the APIs i get in json format. How do I get a specific API by its name and then get it's ID. For example let ...
I have data like following The list might continue grow. I am trying to find out a proper struct to server the data and return to A http responsewr ...
type A struct { Name *NameS `json:"name"` } for a struct A,is there a method in reflect that I can find a field by structtag like reflect.Valu ...
For some of my projects, I have had to use the viper package to use configuration. The package requires you to add the mapstructure:"fieldname" to ide ...
The following code unmarshal's the "Id", but not the "Hostname". Why? I've been staring at it for long enough now that if it's a typo I know I'll neve ...