go-context icon indicating copy to clipboard operation
go-context copied to clipboard

No-longer necessary to import context package

Open supr opened this issue 7 years ago • 1 comments

  • Since go 1.9 there is no need for importing context package from golang.org/x/net/context.
  • With this PR the context package from the stdlib should work.
  • calls the cancel functions for contexts in the test package.

As part of an internal package, there is a dependency on the jbenet/go-context package, along with a necessity of not being able to import golang.org/x/net/context package, since it is already available in the standard library.

@jbenet please review and advise.

supr avatar Mar 13 '19 21:03 supr

That's now required with a recent Go, as seen when attempting to use godef for example:

$ /gnu/store/hjnfnay8m7iwmfyvdjyw7b79wldjvmgc-godef-1.1.2-0.dbdb472/bin/godef -f main.go "main()"
2025/06/01 20:16:19 internal error: package "golang.org/x/net/context" without types was imported from "github.com/jbenet/go-context/io"

apteryks avatar Jun 01 '25 11:06 apteryks