mdempsky/unconvert

Build tags support.

dmitshur opened this issue · 1 comments

This is a feature request.

It'd be nice to add a flag to be able to specify custom build tags.

For example, I have some code behind a // +build dev constraint that I'd like to run unconvert on.

My first impression is that this should be easy to add, just need to set build.Context.BuildTags here:

unconvert/unconvert.go

Lines 296 to 299 in beb68d9

ctxt := build.Default
ctxt.GOOS = os
ctxt.GOARCH = arch
ctxt.CgoEnabled = cgoEnabled

Care will need to be taken to make it intersect well with -all flag.