unixpickle / gobfuscate

Obfuscate Go binaries and packages
BSD 2-Clause "Simplified" License
1.45k stars 157 forks source link

Error happens when renaming a build-tags specific symbol #5

Closed XiaoMouR closed 5 years ago

XiaoMouR commented 6 years ago

A demo package like follows, main.go

package main

func main() {
   Test()
}

a.go

// +build TagA

package main
import "fmt"
var A = "A"
func Test() {
  fmt.Println("I'm tag ", A)
}

b.go

// +build !TagA

package main
func Test() {
  fmt.Println("I'm not A")
}

When try to obfuscate this package, it will report an error like top-level renaming: package "xxxxx" has no member "A".

XiaoMouR commented 6 years ago

Is there some way that we can omit the symbol refactor of a.go?