Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
package main | |
import ( | |
"fmt" | |
) | |
type Node struct { | |
Value int | |
} |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
pingChan := make(chan string) | |
pongChan := make(chan string) |
This is not an exhaustive list of all interfaces in Go's standard library.
I only list those I think are important.
Interfaces defined in frequently used packages (like io
, fmt
) are included.
Interfaces that have significant importance are also included.
All of the following information is based on go version go1.8.3 darwin/amd64
.
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" | |
"strconv" |
package main | |
// Here's a simple example to show how to properly terminate multiple go routines by using a context. | |
// Thanks to the WaitGroup we'll be able to end all go routines gracefully before the main function ends. | |
import ( | |
"context" | |
"fmt" | |
"math/rand" | |
"os" |
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"sync" | |
"time" | |
) |
@echo off | |
REM Make sure that the path to the script is correct! | |
@bash -l -c "~/bin/gitkraken-wsl-bash.sh %*" |
func count(reader *bufio.Reader) (int, error) { | |
count := 0 | |
for { | |
line, _, err := reader.ReadLine() | |
if err != nil { | |
switch err { | |
default: | |
return 0, errors.Wrapf(err, "unable to read") | |
case io.EOF: | |
return count, nil |