Ai
1 Star 0 Fork 0

J-star/BaiduPCS-Go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
quota.go 490 Bytes
一键复制 编辑 原始数据 按行查看 历史
package pcscommand
import (
"fmt"
"github.com/iikira/BaiduPCS-Go/pcsutil/converter"
)
// RunGetQuota 执行 获取当前用户空间配额信息, 并输出
func RunGetQuota() {
quota, used, err := GetBaiduPCS().QuotaInfo()
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("用户名: %s, 总空间: %s, 已用空间: %s, 比率: %f%%\n",
GetActiveUser().Name,
converter.ConvertFileSize(quota),
converter.ConvertFileSize(used),
100*float64(used)/float64(quota),
)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/j-star/BaiduPCS-Go.git
git@gitee.com:j-star/BaiduPCS-Go.git
j-star
BaiduPCS-Go
BaiduPCS-Go
v3.5.6

搜索帮助