github.com/gopherjs/gopherjs@v1.19.0-beta1.0.20240506212314-27071a8796e4/tests/testdata/linkname/two/two.go (about)

     1  package two
     2  
     3  import _ "unsafe" // for go:linkname
     4  
     5  func init() {
     6  	// Avoid dead-code elimination.
     7  	// TODO(nevkontakte): This should not be necessary.
     8  	_ = doInternalOne
     9  }
    10  
    11  func DoTwo() string {
    12  	return "doing two"
    13  }
    14  
    15  // The function below can't be imported from the package one the normal way because
    16  // that would create an import cycle.
    17  //go:linkname doInternalOne github.com/gopherjs/gopherjs/tests/testdata/linkname/one.doInternalOne
    18  func doInternalOne() string
    19  
    20  func DoImportedOne() string {
    21  	return "doing imported one: " + doInternalOne()
    22  }