what is the default size of the gorm library for golang? what is the default size of string? Is it 255? http: gorm.io zh_CN docs mod. type:varchar(100)type:varchar(255) ...
what is the difference between unique_index and unique in the red box of ORM framework gorm, in go language? ...
the codes of a.go, b.go and a.go in the same level directory under 1.windows are as follows: package main import ( "fmt" "os" ) func main() { fi, err := os.Stat("b.go") if err != nil { fmt.Println...
how do Goland align identifiers when writing structures? Something like this: does have shortcut keys? Or can I just press the space manually? ...
MySQL table with the following structure CREATE TABLE `t_article` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `content` varchar(255) NOT NULL COMMENT , `like_count` int(10) unsigned NOT NULL DEFAULT 0 COMMENT , PRIMARY KEY (...
problem description the table is as follows < table id= "coinmarket " > < thead > < tr > < th > ranking < th > < th > currency < th > < th > currency name < th > < th > Price (USD) < th > < th > Market capitalization (USD) < th > < th > ...
golang s gorm defines a field to save the picture list question: type Article struct { BaseModel Title string `json:"title" gorm:"type:varchar(64);not null"` Content string `json:"content" g...
use golang to develop the gin framework for backend api,. Now every time you finish writing an interface, you need to run go build xxx to perform a compilation, then execute the compiled binary file, and then debug the interface. There is a problem in...
gorm creates records. What s the difference between NewRecord and Create? The code is as follows: user := User{Name: "Jinzhu", Age: 18, Birthday: time.Now()} db.NewRecord(user) => `true` db.Create(&user) db.NewRecord(user) =>...
gin framework of go language + mysql to do web development, the association between models, here is an example: package model import "time" Article type Article struct { ID uint `gorm:"primary_key" json:&q...
package main import ( "database sql driver" "fmt" "time" ) type JSONTime struct { time.Time } MarshalJSON on JSONTime format Time field with %Y-%m-%d %H:%M:%S func (t JSONTime) MarshalJSON() ([]byte, er...
I read the mysql information from the configuration file. How do mysql hosts, users, passwords, and database names be passed to sql.open () as variables? cfg, err := ini.Load("setting.ini") cfg.BlockMode = false if err != nil { panic(er...
problem description os.Getenv ( "GOPATH ") cannot be obtained, but os.Getenv ( "HOME ") can get normally. the environmental background of the problems and what methods you have tried in the terminal, ech $GOPATH output normally, GOPATH variable is...
When go returns a json string, is it true that only fields with uppercase or all uppercase letters in the structure will be returned? type User struct { Id int Name string sex string } me := User{Id: 12, Name: &quo...
I use cloudboot to install the system automatically, and the injected information is correct. I can also restart and start the installation automatically, but I always report an error, such as an error in the code. I don t understand it and solve the p...
package main func test() { arr := []string{ "1","2","3", } inter := ArrayToInterface(arr) inter? } func ArrayToInterface(t interface{}) interface{} { ...
SQL I want to implement select * from movies left join server on movies.server_id = server.id here is my go code. I don t know what the problem is. The data of the queried server field is not correct . type Server struct { Id int64 `gor...
``` func isNumber(n int) bool { var i, j, k int i = n % 10 j = (n 10) % 10 k = (n 100) % 10 sum := i*i*i + j*j*j + k*k*k return sum == n } ```...
the environment I use is go version go1.11.1 windows amd64 xorm + Sqlite3 I am using type User struct { Id int `json:"id" xorm:"pk autoincr unique(UNIQUE) INT(10) notnull"` Name string `json:"name" xorm...
In golang, os.exit () runtime.Goexit () return what s the difference? ...
A rookie has an idiot question to ask for help, please do not hesitate to comment, thank you very much! The browser issues an HTTP request to http: www.myserver.com abc def. The server uses a framework to map the URL to classes Handlers ghi.php,gh...
would like to ask you, using window.print () to print a page, if the content of the page is very long, will there be incomplete printing? ...
I have multiple input tags, each with a multiple attribute, so as to upload multiple files of different categories. How can I get the total upload progress of files, and then display the upload progress bar? I have looked for some cases on the Inte...
goal: you want to launch the current request repeatedly when the request ip fails, or when the CAPTCHA is encountered, until the request succeeds, so as to reduce the data omission of crawling. question: I don t know if my thinking is correct. At pres...
<a class="glyphicon glyphicon-chevron-down" id="row">< a> $("-sharprow").click(function(){ $(this).toggleClass( glyphicon glyphicon-chevron-up ); }) Why can t I change the direction of the arrow? ...