浏览代码

codec: clean up use of appengine and safe build tags

First, in build constraints, 'safe' is synonymous with 'appengine'.
Ensure this is honored in the build constraints.

Then, use the following logic to handle treatment of safe tags,
as they show in files.

  < go 1.7                === helper_not_unsafe.go
  go1.7+, safe tag        === helper_not_unsafe.go

  go1.7-1.11, safe tag    === goversion_maprange_lt_go112.go
  go1.12+, safe tag       === goversion_maprange_gte_go112.go
  go1.7+, NO safe tag     === helper_unsafe.go

Fixes #310
Ugorji Nwoke 6 年之前
父节点
当前提交
e118e2d506
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      codec/goversion_maprange_gte_go112.go
  2. 2 1
      codec/goversion_maprange_lt_go112.go

+ 1 - 1
codec/goversion_maprange_gte_go112.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a MIT license found in the LICENSE file.
 
 // +build go1.12
-// +build safe
+// +build safe appengine
 
 package codec
 

+ 2 - 1
codec/goversion_maprange_lt_go112.go

@@ -1,8 +1,9 @@
 // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
 // Use of this source code is governed by a MIT license found in the LICENSE file.
 
+// +build go1.7
 // +build !go1.12
-// +build !go1.7 safe
+// +build safe appengine
 
 package codec