forked from chadit/dotfiles_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_go_tools.sh
executable file
·129 lines (111 loc) · 6.41 KB
/
install_go_tools.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/bash
func ()
{
echo "Install/Upgrading go tools ..."
# check if folder exist, and reset them (sometimes syncing can cause issues)
if [ -d "/home/chadit/Projects/src/cloud.google.com/go" ]; then
cd /home/chadit/Projects/src/cloud.google.com/go && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/golang.org/x/tools/cmd" ]; then
cd /home/chadit/Projects/src/golang.org/x/tools/cmd && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/golang.org/x/tools/cmd/gorename" ]; then
cd /home/chadit/Projects/src/golang.org/x/tools/cmd/gorename && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/golang.org/x/tools/cmd/guru" ]; then
cd /home/chadit/Projects/src/golang.org/x/tools/cmd/guru && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/golang.org/x/tools/cmd/cover" ]; then
cd /home/chadit/Projects/src/golang.org/x/tools/cmd/cover && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/derekparker/delve/cmd/dlv" ]; then
cd /home/chadit/Projects/src/github.com/derekparker/delve/cmd/dlv && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/nsf/gocode" ]; then
cd /home/chadit/Projects/src/github.com/nsf/gocode && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/rogpeppe/godef" ]; then
cd /home/chadit/Projects/src/github.com/rogpeppe/godef && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/golang/lint" ]; then
cd /home/chadit/Projects/src/github.com/golang/lint && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/golang/lint/golint" ]; then
cd /home/chadit/Projects/src/github.com/golang/lint/golint && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/lukehoban/go-outline" ]; then
cd /home/chadit/Projects/src/github.com/lukehoban/go-outline && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/cweill/gotests" ]; then
cd /home/chadit/Projects/src/github.com/cweill/gotests && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/sourcegraph/go-langserver" ]; then
cd /home/chadit/Projects/src/github.com/sourcegraph/go-langserver && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/alecthomas/gometalinter" ]; then
cd /home/chadit/Projects/src/github.com/alecthomas/gometalinter && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/ramya-rao-a/go-outline" ]; then
cd /home/chadit/Projects/src/github.com/ramya-rao-a/go-outline && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/sourcegraph.com/sqs/goreturns" ]; then
cd /home/chadit/Projects/src/sourcegraph.com/sqs/goreturns && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/tpng/gopkgs" ]; then
cd /home/chadit/Projects/src/github.com/tpng/gopkgs && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/newhook/go-symbols" ]; then
cd /home/chadit/Projects/src/github.com/newhook/go-symbols && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/fatih/gomodifytags" ]; then
cd /home/chadit/Projects/src/github.com/fatih/gomodifytags && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/josharian/impl" ]; then
cd /home/chadit/Projects/src/github.com/josharian/impl && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/gopkg.in/olivere/elastic.v2" ]; then
cd /home/chadit/Projects/src/gopkg.in/olivere/elastic.v2 && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/gopkg.in/olivere/elastic.v5" ]; then
cd /home/chadit/Projects/src/gopkg.in/olivere/elastic.v5 && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "/home/chadit/Projects/src/github.com/docker/docker-credential-helpers" ]; then
cd /home/chadit/Projects/src/github.com/docker/docker-credential-helpers && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
if [ -d "~/.vim/bundle/vim-go/" ]; then
cd ~/.vim/bundle/vim-go/ && echo `pwd` && reset_branch && git pull && git prune && git gc --aggressive
fi
# Get/Update/Install
go get -u github.com/derekparker/delve/cmd/dlv
gocode close && go get -u github.com/nsf/gocode
go get -u golang.org/x/tools/...
go get -u golang.org/x/tools/cmd/gorename
go get -u github.com/tpng/gopkgs
go get -u github.com/acroca/go-symbols
go get -u github.com/golang/lint/golint
go get -u github.com/fatih/gomodifytags
go get -u github.com/josharian/impl
go get -u github.com/redefiance/go-find-references
go get -u github.com/jstemmer/gotags
go get -u github.com/client9/misspell/cmd/misspell
go get -u github.com/adjust/go-wrk
go get -u github.com/uber/go-torch
go get -u github.com/rogpeppe/godef
go get -u github.com/cweill/gotests/...
go get -u github.com/lukehoban/go-outline
go get -u github.com/ramya-rao-a/go-outline
go get -u sourcegraph.com/sqs/goreturns
go get -u honnef.co/go/tools/cmd/staticcheck
go get -u honnef.co/go/tools/cmd/megacheck
go get -u github.com/alecthomas/gometalinter
go get -u github.com/docker/docker-credential-helpers
gometalinter --install
# use https://github.com/docker/docker-credential-helpers/releases to install cred
}
# Reset a branch with Origin
reset_branch(){
git fetch --prune
git reset --hard @{upstream}
git clean -x -d -f
}
func