golang

Related Articles

Golang Parsing Csv File, Parse Error: Extraneous Or Missing " in Quoted-field

The system for parsing Baidu Statistics CSV logs has been running for almost a month with no problems. But this morning, it suddenly reported the following error. > import_log /mnt/d/to_del/2020-06-20.csv 2020/06/22 07:55:18 parse error on line 686 , column 60: extraneous or missing " in quo ...

Read more ...

Upgrade Go Install Installed Versions of 3rd Party Tools

Today, while using the adm generate command from GoAdmin, I found a new version prompt. GoAdmin CLI v1.2.9, the latest version is v1.2.13 now. The adm command line tool is installed by go install. So I tried to run it again: > go install github.com/GoAdminGroup/go-... admin/adm But after insta ...

Read more ...

Golang Debug Third Party Libraries Code on Local Machine

GoAdmin, which is a golang library being used in my golang project, found a bug in the datetime component. Time component cannot be switched Chinese locale Filtering is not effective. Current speculation is that the date formatting is due to locale issues Wanted to debug it myself to see if it cou ...

Read more ...

golang reads and parses csv files

Exported and downloaded the CSV file of live visitors from the Baidu statistics background. I want to parse it locally and import it into MySQL for backup, because Baidu statistics can only keep two weeks of historical data, and the limit is 5000 items. golang resolves csv code The golang's built-in ...

Read more ...

golang line break error: expected statement, found '.'

When writing golang code, I encountered a line of code that was too long, so I habitually refer to PHP's line break method. info.AddField("Name", "name", db.Varchar) .FieldFilterable(types.FilterType{Operator: types.FilterOperatorLike}) However, when VIM saves, the trigger ...

Read more ...

Reduce the File Size of the Golang Build Compiled Package

After using Golang Gin wrote the backend program with GoAdmin, the volume of the distribution package generated by go build has reached a whopping 30M. Upload Ali Cloud Server, which has a transfer speed of 400K/s for 1 minute. 30075408 Find a solution online, plus compilation parameters. go build ...

Read more ...

Golang Gin & Nginx to Get Real Ip of Visitors

In the golang gin controller c.ClientIP() Gets the IP of the request, but gets 127.0.0.1. Presumably Nginx was not configured when it forwarded the request to golang process. Solutions Just add two lines to the configuration. location /go/ { proxy_set_header X-Forward-For $remote_addr; ...

Read more ...

Go Get Show Golang Package Download Progress

It took a long time to execute today while downloading a golang package, and it didn't finish. The order is as follows. go get github.com/GoAdminGroup/go-admin/adm I don't know if it's the network that's down, or what, because by default GO GET doesn't show progress. A workaround was found on Reddi ...

Read more ...

Golang Include Nested Template With Variable

golang gin controller Send variable kv to template c.HTML(http.StatusOK, "index.html", gin.H{ "kv": kv, }) template index.html Include nested template footer.html, and send variable with dot (.) to footer.html {{ template "footer.html" . }} template footer.html &l ...

Read more ...

Comparison of Golang Gin, Kotlin Springboot, PHP Laravel and How to Choose

Different business scenarios use different framework. PHP Laravel Advantage: Development efficiency is not so fast. When there is an idea, it can be realized in an instant. I still think that if it's as a personal side project, as a trial and error, it's really the first choice to develop with lara ...

Read more ...