Skip to main content
Go的语法

声明变量

var name string = "huhx"
var name = "huhx"
name: "huhx"

var name, address string = "huhx", "hubei"
var name, address = "huhx", "hubei"
name, address := "huhx", "hubei"

huhxAbout 1 mingoGoBasic
Cobra命令行

cobra

cobra-cli

# install
go install github.com/spf13/cobra-cli@latest

# 如果执行安装了,cobra-cli command not found,对么参考:https://github.com/spf13/cobra/issues/1964

# create repo
mkdir demo && cd demo

# download dependencies
go mod init demo
go mod tidy

# more
cobra-cli init --author "huhx" --viper --license apache
touch $HOME/.demo.yaml

# add command
cobra-cli add team
cobra-cli add create -p 'teamCmd'

huhxLess than 1 minutegoGo
OSS图片迁移实战

aliyun-oss sdk

viper config

current: local
local:
  path: 
  name: 
remote:
  bucket:
  key-id:
  key-secret:

huhxOriginalLess than 1 minutegoGoProject