I have similar situation where I need to compile a package specifically for 
android and other specifically for linux.
I have included constraints mentioned above for pure linux and pure android 
compilation but still both files
are getting built and I get error.

GOOS=android
GOARCH=arm

Android specific files are named as *_android.go with build constraint "// 
+build android"
and 
Linux specific files are named as *_linux.go with build constraints "// 
+build !android,linux"

Thanks in advance.

On Thursday, September 1, 2016 at 5:09:05 AM UTC+5:30, Nigel Tao wrote:
>
> On Wed, Aug 31, 2016 at 4:45 AM, Sapna Todwal <sapna....@gmail.com 
> <javascript:>> wrote: 
> > I already tried this and it doesn't work . 
>
> That's odd. It should work. What are your filenames? What do your "// 
> +build" lines look like exactly? 
>
>
> > Also I need a way to enable 
> > certain code only for pure android and not linux. Any suggestions ?? 
>
> // +build android 
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to