From bdaa8bfb98b56b85d4d96c8190e7c8dd049ffcb5 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Fri, 19 Feb 2021 11:05:58 -0800 Subject: [PATCH] go/gcexportdata: warn that {Read,Write}Bundle are experimental After playing with these a little, they definitely get the job done. But I'm already seeing a few ways the API could be nicer (e.g., provide a bundle-backed go/importer.Importer implementation that reads packages out on demand, so unneeded packages don't need to be read). So mark these APIs as experimental so users know not to get too attached to them just yet. Change-Id: Idb98f45095a0c6f9825ff07172f62c42d8453016 Reviewed-on: https://go-review.googlesource.com/c/tools/+/294310 Reviewed-by: Rebecca Stambler Trust: Matthew Dempsky --- go/gcexportdata/gcexportdata.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go/gcexportdata/gcexportdata.go b/go/gcexportdata/gcexportdata.go index 04b65b61f6..fc8beea5d8 100644 --- a/go/gcexportdata/gcexportdata.go +++ b/go/gcexportdata/gcexportdata.go @@ -114,6 +114,8 @@ func Write(out io.Writer, fset *token.FileSet, pkg *types.Package) error { // within the export bundle to other packages are consistent. // // On return, the state of the reader is undefined. +// +// Experimental: This API is experimental and may change in the future. func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Package) ([]*types.Package, error) { data, err := ioutil.ReadAll(in) if err != nil { @@ -124,6 +126,8 @@ func ReadBundle(in io.Reader, fset *token.FileSet, imports map[string]*types.Pac // WriteBundle writes encoded type information for the specified packages to out. // The FileSet provides file position information for named objects. +// +// Experimental: This API is experimental and may change in the future. func WriteBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { return gcimporter.IExportBundle(out, fset, pkgs) }