aliyun / alibaba-cloud-sdk-go

Alibaba Cloud SDK for Go
Apache License 2.0
1.16k stars 271 forks source link

引入 github.com/aliyun/alibaba-cloud-sdk-go/services/cloudauth 包后无法编译 #542

Closed wpxun closed 2 years ago

wpxun commented 2 years ago

import ( _ "github.com/aliyun/alibaba-cloud-sdk-go/services/cloudauth" )

没有写任何逻辑代码,只要引入上面的包,项目就无法 build

go 1.17.3 sdk: v1.61.1361 SDK项目:services/cloudauth 系统:windows 11

wpxun commented 2 years ago

整个项目就两个文件,一个main.go,一个 go.mod。 main.go文件:

package main

import (
    "fmt"
    _ "github.com/aliyun/alibaba-cloud-sdk-go/services/cloudauth"
)

func main() {
    fmt.Println("test")
}

go.mod 文件:

module abc

go 1.17

require github.com/aliyun/alibaba-cloud-sdk-go v1.61.1361

require (
    github.com/jmespath/go-jmespath v0.4.0 // indirect
    github.com/json-iterator/go v1.1.10 // indirect
    github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
    github.com/modern-go/reflect2 v1.0.1 // indirect
    gopkg.in/ini.v1 v1.62.0 // indirect
    gopkg.in/yaml.v2 v2.3.0 // indirect
)

运行 go run main.go 没有任何输出,去掉 cloudauth 包依赖后,就输出正常。