From 1571f0517c11c99e28917f1f6415e2c3ff539583 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 19 May 2019 19:17:22 +0700 Subject: all: fix the main generate directive to use "+build ignore" The latest change on Go tip [1] somehow make the "go generate" with "+build generate" on main package cause an error, can't load package: package github.com/shuLhan/ciigo: found packages ciigo (ciigo.go) and main (generate_main.go) in /home/ms/go/src/github.com/shuLhan/ciigo From the source code of Go itself, seems like the correct directive is "+build ignore" instead of "+build generate". [1] https://github.com/golang/go/issues/31920 --- generate.go | 4 ++-- generate_main.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generate.go b/generate.go index df0cb95..c1e3cc0 100644 --- a/generate.go +++ b/generate.go @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package ciigo - //go:generate go run generate_main.go +package ciigo + import ( "log" "os" diff --git a/generate_main.go b/generate_main.go index b458e64..61c5bed 100644 --- a/generate_main.go +++ b/generate_main.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build generate +// +build ignore package main -- cgit v1.3