使用空struct{}代替bool节约内存

This commit is contained in:
GoEdgeLab
2021-12-09 12:07:46 +08:00
parent 6be26c0ffb
commit 82709e274c
15 changed files with 126 additions and 63 deletions

9
internal/zero/zero.go Normal file
View File

@@ -0,0 +1,9 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package zero
type Zero = struct{}
func New() Zero {
return Zero{}
}