committed by
GitHub
parent
9eb409b935
commit
3cfe40e76c
@@ -35,7 +35,7 @@ func NewContext() *Context {
|
|||||||
// Package sets the package the generated file will belong to. Required to be able to reference types in the package.
|
// Package sets the package the generated file will belong to. Required to be able to reference types in the package.
|
||||||
func (c *Context) Package(path string) {
|
func (c *Context) Package(path string) {
|
||||||
cfg := &packages.Config{
|
cfg := &packages.Config{
|
||||||
Mode: packages.LoadTypes,
|
Mode: packages.LoadAllSyntax,
|
||||||
}
|
}
|
||||||
pkgs, err := packages.Load(cfg, path)
|
pkgs, err := packages.Load(cfg, path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
14
tests/fixedbugs/issue62/asm.go
Normal file
14
tests/fixedbugs/issue62/asm.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
. "github.com/mmcloughlin/avo/build"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
Package("github.com/mmcloughlin/avo/tests/fixedbugs/issue62")
|
||||||
|
Implement("private")
|
||||||
|
RET()
|
||||||
|
Generate()
|
||||||
|
}
|
||||||
5
tests/fixedbugs/issue62/issue62.s
Normal file
5
tests/fixedbugs/issue62/issue62.s
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// Code generated by command: go run asm.go -out issue62.s. DO NOT EDIT.
|
||||||
|
|
||||||
|
// func private()
|
||||||
|
TEXT ·private(SB), $0
|
||||||
|
RET
|
||||||
11
tests/fixedbugs/issue62/issue62_test.go
Normal file
11
tests/fixedbugs/issue62/issue62_test.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package issue62
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:generate go run asm.go -out issue62.s
|
||||||
|
|
||||||
|
func TestPrivate(t *testing.T) {
|
||||||
|
private()
|
||||||
|
}
|
||||||
5
tests/fixedbugs/issue62/stub.go
Normal file
5
tests/fixedbugs/issue62/stub.go
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// Package issue62 tests for using Implement() with an unexported function.
|
||||||
|
package issue62
|
||||||
|
|
||||||
|
// private serves as an example unexported function to implement.
|
||||||
|
func private()
|
||||||
Reference in New Issue
Block a user