-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdep.sh
28 lines (24 loc) · 1015 Bytes
/
dep.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
#!/bin/bash
export GO111MODULE=on
download=""
go_version=$(go version | awk '{ print $3 }')
# go 1.17 之后下载编译成可执行文件要使用 go install
if ! (printf '%s\n%s\n' "go1.17" "${go_version}" | sort -V -C); then
echo "go get dependencies..."
download="go get"
else
echo "go install dependencies..."
download="go install"
fi
# jq: https://github.com/jqlang/jq/releases - mac: `brew install jq` or `brew upgrade jq`
# protoc: https://github.com/protocolbuffers/protobuf/releases/tag/v25.1 - v4.25.1
# 需要 go1.21 以上版本构建安装
${download} google.golang.org/protobuf/cmd/[email protected]
${download} google.golang.org/grpc/cmd/[email protected]
${download} github.com/golangci/golangci-lint/cmd/[email protected]
${download} golang.org/x/tools/cmd/[email protected]
${download} github.com/incu6us/goimports-reviser/[email protected]
${download} mvdan.cc/[email protected]
${download} mvdan.cc/sh/v3/cmd/[email protected]
${download} mvdan.cc/sh/v3/cmd/[email protected]
echo "done"