我的命令行go get或go get .Golang 项目有问题。错误是
go: module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.
Run Code Online (Sandbox Code Playgroud)
我已尝试在此网站中逐步安装包 protobuf在此处输入链接描述
但我无法解决我的问题。
我想将 .png 格式的图像上传到 MinIo。但我遇到错误找不到目录的问题
Error: open /sensors/download (1).png: no such file or directory
Run Code Online (Sandbox Code Playgroud)
我在 minio 存储桶内创建了一个名为 ems_service 的目录文件,其名称为传感器名称。
就像我编写的使用 Go 和 Minio 上传图像文件的代码一样
ctx := context.Background()
endpoint := config.MINIO_ENDPOINT
accessKeyID := config.MINIO_ID
secretAccessKey := config.MINIO_KEY
useSSL := true
contentType := "image/png"
location := "us-east-1"
utilities.Info.Printf("secret access key: %+v", secretAccessKey)
utilities.Info.Printf("access ID: %+v", accessKeyID)
// Initialize minio client object.
minioClient, err := minio.New(endpoint, &minio.Options{
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
Secure: useSSL,
})
// minioClient, err := minio.New(endpoint, accessKeyID, secretAccessKey, useSSL)
if err …Run Code Online (Sandbox Code Playgroud)