golang

Goignore

Nov 26, 2021
#tech #golang

Goignore - A .gitignore wizard which gnerates .gitignore files from the command line for you. Inspired by joe 1. Features # No installation necessary - just use the binary. Works on Linux, Windows & MacOS. Interactive user interface with bubbletea: Pagination, Filtering, Help… Supports all Github-supported .gitignore files. 2. Install # Download the latest binary from the Release page. It’s the easiest way to get started with goignore. Make sure to add the location of the binary to your $PATH. ...

Golang: Block forever

Apr 27, 2020
#golang #trick #note

Sometimes, you want to block the current goroutine when allowing others to continue. Here is some tricks I’ve collected: 1. References # Firstly give them some credits: https://blog.sgmansfield.com/2016/06/how-to-block-forever-in-go/ https://pliutau.com/different-ways-to-block-go-runtime-forever/ NOTE: I run these with Golang 1.12 2. The original # package main import "fmt" func show() { for i := 1; i < 9696969; i++ { time.Sleep(1000) fmt.Println(i) } } func main() { go show() // The main goroutine is exited before the show() be done. ...