简体   繁体   中英

invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required

When I run go build, there is always an error:

go: finding github.com/shirou/gopsutil v2.19.6+incompatible

go list -m: github.com/shirou/gopsutil@v2.19.6+incompatible: invalid version: +incompatible suffix not allowed: module contains a go.mod file, so semantic import versioning is required

How can I fix it?

I use go mod and go version 1.13.5

After go 1.13, new validation has been added.

This is new validation in 1.13 see Version validation in https://golang.org/doc/go1.13 for details.

To fix this, go down to version 1.13,

or

Changed go.mod to add v2 in module module github.com/shirou/gopsutil -> module github.com/shirou/gopsutil/v2

here is link detail

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM