FAQ Database Discussion Community


Encode array to base64 in go

xml,go,base64,gorp
Here is my complete code for a function I develop: package main import ( "database/sql" "log" "encoding/xml" "github.com/gin-gonic/gin" //golang frameworks _ "github.com/go-sql-driver/mysql" "gopkg.in/gorp.v1" //work with database(mysql, etc.) ) type Genre struct { Title string `xml:"genre"` } type GenreArray struct { Auth_state int `xml:"auth_state"` Count int64 `xml:"count"` Item genreAPI `xml:"item"` }...

How to set default value for a column on CreateTables()?

go,gorp
I am using gorp, and I want to create a table with DbMap#CreateTables() by setting a default value for a column. How can I achieve this?...