Note Feel

Keep Simple, Keep Foolish.

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 ...

Modify the Shell Opened By Default in Windows Terminal

Every time you open Windows Terminal, it opens the Power Shell by default, but I only use WSL Ubuntu. So, I would like to set WSL Shell to open by default. Just click on the drop down arrow at the top, select "Settings" and change the value of defaultProfile to the corresponding value of t ...

Read more ...

Cycling Goggles, Essential For Cycling to Work

Why I need a pair of cycling goggles At the end of May, the epidemic eased up and I started cycling to work. I wore a normal mask to avoid inhaling dust from the road. However, the sand raised by the big car on the main road, as well as small flying insects, willow wool, often into the eyes. The mos ...

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 ...

Windows Terminal Default Configuration Ctrl V Conflicts With Vim Shortcuts

When using Windows Terminal, it was found that ctrl v conflicts with the column operation shortcut of vim. Solutions Modify the configuration file. Click on "Down arrow" - "Settings" and select Notepad to open the JSON format configuration file. Find this configuration. // Copy a ...

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 ...

Google Online PNG, JPG Image Compression Tool Squoosh

The Windows native program FileOptimizer has been used to compress PNG, JPG images. But a nice online tool alternative was recently discovered, squoosh, at. https://squoosh.app/ The advantages of squoosh over FileOptimizer Compression is faster. squoosh is almost instantaneous, and FileOptimizer s ...

Read more ...

Is the Lg Gram 17 Inch Worth Getting

Pros The screen is big enough, 17 inches perfect. Because the thing I'm most unhappy with about the Lenovo Xiaoxin Pro 13 I'm currently using is that the screen is too small, and a 13-inch screen is a fatal flaw no matter how high the screen resolution is. Especially for programmers. Lightweight an ...

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 ...