github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/compile/internal/importer/iimport.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Indexed package import.
     6  // See cmd/compile/internal/typecheck/iexport.go for the export data format.
     7  
     8  package importer
     9  
    10  import (
    11  	"github.com/shogo82148/std/cmd/compile/internal/types2"
    12  )
    13  
    14  // ImportData imports a package from the serialized package data
    15  // and returns the number of bytes consumed and a reference to the package.
    16  // If the export data version is not recognized or the format is otherwise
    17  // compromised, an error is returned.
    18  func ImportData(imports map[string]*types2.Package, data, path string) (pkg *types2.Package, err error)