golang-design/clipboard

Backward compatibility for Go 1.16

FrankFang opened this issue · 3 comments

Newbie here.
When I ran commands below:

$ go version
go version go1.16.8 linux/amd64
$ go mod init main
$ touch main.go
$ go get -u golang.design/x/clipboard                                                                                                                                     ✘ 1 
//go:build comment without // +build comment
$ go run main                                                                                                                                                             ✘ 1 
main.go:4:8: no required module provides package golang.design/x/clipboard; to add it:
        go get golang.design/x/clipboard
$ go get golang.design/x/clipboard                                                                                                                                        ✘ 1 
//go:build comment without // +build comment

I got //go:build comment without // +build comment, but the go.mod file never changed.
So how could I install golang-design/clipboard?

main.go

package main

import "fmt"
import "golang.design/x/clipboard"

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

It works well for go 1.17.
Just upgrade go!

Yes, starting from 0.5, the package requires 1.17. If you can only use 1.16, then 0.4.6 can be an option for you.

Reopen for backward compatibility in Go 1.16. Also because of golang/go#48509.