You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			47 lines
		
	
	
		
			847 B
		
	
	
	
		
			Plaintext
		
	
			
		
		
	
	
			47 lines
		
	
	
		
			847 B
		
	
	
	
		
			Plaintext
		
	
garble build
 | 
						|
exec ./main
 | 
						|
cmp stdout main.stdout
 | 
						|
 | 
						|
! bingrep main$exe 'ImportedVar' 'ImportedConst' 'ImportedFunc' 'ImportedType'
 | 
						|
 | 
						|
# Also check that the binary is reproducible when many imports are involved.
 | 
						|
cp main$exe main_old$exe
 | 
						|
rm main$exe
 | 
						|
garble build
 | 
						|
bincmp main$exe main_old$exe
 | 
						|
 | 
						|
-- go.mod --
 | 
						|
module foo.com/main
 | 
						|
-- main.go --
 | 
						|
package main
 | 
						|
 | 
						|
import (
 | 
						|
	"fmt"
 | 
						|
	"foo.com/main/imported"
 | 
						|
)
 | 
						|
 | 
						|
func main() {
 | 
						|
	fmt.Println(imported.ImportedVar)
 | 
						|
	fmt.Println(imported.ImportedConst)
 | 
						|
	imported.ImportedFunc('x')
 | 
						|
	fmt.Println(imported.ImportedType(3))
 | 
						|
	fmt.Println(nil)
 | 
						|
}
 | 
						|
-- main.stdout --
 | 
						|
imported var value
 | 
						|
imported const value
 | 
						|
3
 | 
						|
<nil>
 | 
						|
-- imported/imported.go --
 | 
						|
package imported
 | 
						|
 | 
						|
var ImportedVar = "imported var value"
 | 
						|
 | 
						|
const ImportedConst = "imported const value"
 | 
						|
 | 
						|
func ImportedFunc(param rune) string {
 | 
						|
	return string(param)
 | 
						|
}
 | 
						|
 | 
						|
type ImportedType int
 |