Hello I have the struct like here named person and when I call my rest endpoint and get data from mssql database (where ID is
ID UNIQUEIDENTIFIER DEFAULT NEWSEQUENTIALID() )
then golang return response with array of number
package entities import ( mssql "github.com/denisenkom/go-mssqldb" "time" ) type Person struct { ID mssql.UniqueIdentifier FullName string Comments string DateCreated time.Time DateModified time.Time }
bad response
after call like api from I get
{ "ID": [ 160,63, 67,62,243,107,20,16,143,174,0, 45,192,113,147,0 ], "FullName": "Tony Stark", "Comments": "", "DateCreated": "2022-04-06T10:12:18.523Z", "DateModified": "2022-04-06T10:12:18.523Z" }
Hello I have the struct like here named person and when I call my rest endpoint and get data from mssql database (where ID is ID UNIQUEIDENTIFIER DEFAULT NEWSEQUENTIALID() )
then golang return response with array of number
package entities import ( mssql "github.com/denisenkom/go-mssqldb" "time" ) type Person struct { ID mssql.UniqueIdentifier FullName string Comments string DateCreated time.Time DateModified time.Time }
bad response after call like api from I get
{ "ID": [ 160,63, 67,62,243,107,20,16,143,174,0, 45,192,113,147,0 ], "FullName": "Tony Stark", "Comments": "", "DateCreated": "2022-04-06T10:12:18.523Z", "DateModified": "2022-04-06T10:12:18.523Z" }
I would like have response like
{ "ID": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11" , "FullName": "Tony Stark", "Comments": "", "DateCreated": "2022-04-06T10:12:18.523Z", "DateModified": "2022-04-06T10:12:18.523Z" }
` func Getperson(w http.ResponseWriter, r *http.Request) { var persons []entities.person //database.Instance.Find(&person)} `
where I have a bug?