Browse Source

Include missing initialization for size entry of integers

abhinavdangeti 1 year ago
parent
commit
06f7c58a35
1 changed files with 24 additions and 22 deletions
  1. 24 22
      size/sizes.go

+ 24 - 22
size/sizes.go

@@ -19,28 +19,30 @@ import (
 )
 
 func init() {
-	var a bool
-	SizeOfBool = int(reflect.TypeOf(a).Size())
-	var b float32
-	SizeOfFloat32 = int(reflect.TypeOf(b).Size())
-	var c float64
-	SizeOfFloat64 = int(reflect.TypeOf(c).Size())
-	var d map[int]int
-	SizeOfMap = int(reflect.TypeOf(d).Size())
-	var e *int
-	SizeOfPtr = int(reflect.TypeOf(e).Size())
-	var f []int
-	SizeOfSlice = int(reflect.TypeOf(f).Size())
-	var g string
-	SizeOfString = int(reflect.TypeOf(g).Size())
-	var h uint8
-	SizeOfUint8 = int(reflect.TypeOf(h).Size())
-	var i uint16
-	SizeOfUint16 = int(reflect.TypeOf(i).Size())
-	var j uint32
-	SizeOfUint32 = int(reflect.TypeOf(j).Size())
-	var k uint64
-	SizeOfUint64 = int(reflect.TypeOf(k).Size())
+	var b bool
+	SizeOfBool = int(reflect.TypeOf(b).Size())
+	var f32 float32
+	SizeOfFloat32 = int(reflect.TypeOf(f32).Size())
+	var f64 float64
+	SizeOfFloat64 = int(reflect.TypeOf(f64).Size())
+	var i int
+	SizeOfInt = int(reflect.TypeOf(i).Size())
+	var m map[int]int
+	SizeOfMap = int(reflect.TypeOf(m).Size())
+	var ptr *int
+	SizeOfPtr = int(reflect.TypeOf(ptr).Size())
+	var slice []int
+	SizeOfSlice = int(reflect.TypeOf(slice).Size())
+	var str string
+	SizeOfString = int(reflect.TypeOf(str).Size())
+	var u8 uint8
+	SizeOfUint8 = int(reflect.TypeOf(u8).Size())
+	var u16 uint16
+	SizeOfUint16 = int(reflect.TypeOf(u16).Size())
+	var u32 uint32
+	SizeOfUint32 = int(reflect.TypeOf(u32).Size())
+	var u64 uint64
+	SizeOfUint64 = int(reflect.TypeOf(u64).Size())
 }
 
 var SizeOfBool int