all: check formatting on CI

This commit is contained in:
Ayke van Laethem
2019-04-12 14:11:23 +02:00
committed by Ron Evans
parent 1322f404a6
commit 02ecab833f
6 changed files with 14 additions and 9 deletions
+3 -3
View File
@@ -134,18 +134,18 @@ func (t Type) String() string {
}
func (t Type) Kind() Kind {
if t % 2 == 0 {
if t%2 == 0 {
// basic type
return Kind((t >> 1) % 32)
} else {
return Kind(t >> 1) % 8 + 19
return Kind(t>>1)%8 + 19
}
}
func (t Type) Elem() Type {
switch t.Kind() {
case Chan, Ptr, Slice:
if (t >> 4) % 2 != 0 {
if (t>>4)%2 != 0 {
panic("unimplemented: (reflect.Type).Elem() for named types")
}
return t >> 5
+2 -2
View File
@@ -335,7 +335,7 @@ func (v Value) Index(i int) Value {
typecode: v.Type().Elem(),
indirect: true,
}
addr := uintptr(slice.Data) + elem.Type().Size() * uintptr(i) // pointer to new value
addr := uintptr(slice.Data) + elem.Type().Size()*uintptr(i) // pointer to new value
elem.value = unsafe.Pointer(addr)
return elem
case String:
@@ -348,7 +348,7 @@ func (v Value) Index(i int) Value {
}
return Value{
typecode: Uint8.basicType(),
value: unsafe.Pointer(uintptr(*(*uint8)(unsafe.Pointer(s.Data + uintptr(i))))),
value: unsafe.Pointer(uintptr(*(*uint8)(unsafe.Pointer(s.Data + uintptr(i))))),
}
case Array:
panic("unimplemented: (reflect.Value).Index()")
+3 -1
View File
@@ -1 +1,3 @@
TheVersion = `go0.1.0`
package sys
const TheVersion = `go0.1.0`