This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi | |
allownonascii=$(git config --bool hooks.allownonascii) | |
exec 1>&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: golang:1.11 | |
# before_script: | |
# 代码格式化 | |
fmt: | |
script: | |
# 代码格式化 | |
- diff -u <(echo -n) <(gofmt $(find . -type f | grep -v vendor/ |grep -v /clients/ |grep -v /thrift_gen/ |grep -v kite.go|grep .go) ) | |
- diff -u <(echo -n) <(goimports $(find . -type f | grep -v vendor/ |grep -v /clients/ |grep -v /thrift_gen/ |grep -v kite.go|grep .go) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "time" | |
import "fmt" | |
func main() { | |
// 在这个例子中, 假设我们执行了一个外部调用, 2秒之后将结果写入c1 | |
c1 := make(chan string, 1) | |
go func() { | |
time.Sleep(time.Second * 2) | |
c1 <- "result 1" | |
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
LOOP_TEST: | |
for j := 1; j < 3; j += 1 { | |
fmt.Println("loop1") | |
for i := 1; i < 3; i = i + 1 { | |
fmt.Println("loop2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mysqld] | |
character-set-server=utf8 | |
collation-server=utf8_general_ci | |
skip-character-set-client-handshake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// grpc | |
go get github.com/golang/protobuf/proto | |
go get github.com/gogo/protobuf/protoc-gen-gofast | |
go get github.com/gogo/protobuf/proto | |
go get github.com/gogo/protobuf/gogoproto | |
go get google.golang.org/grpc | |
// usual | |
go get github.com/golang/glog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind r source-file ~/.tmux.conf \; display-message "Config reloaded" | |
set -g @plugin 'tmux-plugins/tmux-yank' | |
set -g mouse on | |
#禁止 rename window | |
set-option -g allow-rename off | |
set -g status-keys vi | |
set -g history-limit 10000 | |
set-window-option -g mode-keys vi | |
bind-key -T copy-mode-vi 'v' send -X begin-selection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"log" | |
"os/exec" | |
) | |
NewerOlder