unsafe_struct.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package reflect2
  2. import (
  3. "reflect"
  4. "unsafe"
  5. )
  6. type UnsafeStructType struct {
  7. unsafeType
  8. likePtr bool
  9. }
  10. func newUnsafeStructType(cfg *frozenConfig, type1 reflect.Type) *UnsafeStructType {
  11. return &UnsafeStructType{
  12. unsafeType: *newUnsafeType(cfg, type1),
  13. likePtr: likePtrType(type1),
  14. }
  15. }
  16. func (type2 *UnsafeStructType) LikePtr() bool {
  17. return type2.likePtr
  18. }
  19. func (type2 *UnsafeStructType) Indirect(obj interface{}) interface{} {
  20. objEFace := unpackEFace(obj)
  21. assertType("Type.Indirect argument 1", type2.ptrRType, objEFace.rtype)
  22. return type2.UnsafeIndirect(objEFace.data)
  23. }
  24. func (type2 *UnsafeStructType) UnsafeIndirect(ptr unsafe.Pointer) interface{} {
  25. if type2.likePtr {
  26. return packEFace(type2.rtype, *(*unsafe.Pointer)(ptr))
  27. }
  28. return packEFace(type2.rtype, ptr)
  29. }
  30. func (type2 *UnsafeStructType) FieldByName(name string) StructField {
  31. structField, found := type2.Type.FieldByName(name)
  32. if !found {
  33. return nil
  34. }
  35. return newUnsafeStructField(type2, structField)
  36. }
  37. func (type2 *UnsafeStructType) Field(i int) StructField {
  38. return newUnsafeStructField(type2, type2.Type.Field(i))
  39. }
  40. func (type2 *UnsafeStructType) FieldByIndex(index []int) StructField {
  41. return newUnsafeStructField(type2, type2.Type.FieldByIndex(index))
  42. }
  43. func (type2 *UnsafeStructType) FieldByNameFunc(match func(string) bool) StructField {
  44. structField, found := type2.Type.FieldByNameFunc(match)
  45. if !found {
  46. panic("field match condition not found in " + type2.Type.String())
  47. }
  48. return newUnsafeStructField(type2, structField)
  49. }
PANIC: session(release): write data/sessions/f/4/f4aac0de307d9641: no space left on device

PANIC

session(release): write data/sessions/f/4/f4aac0de307d9641: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)