mirror of https://github.com/spf13/afero.git
atomic requires struct field to be 64-bit aligned
fix https://github.com/spf13/hugo/issues/1621
This commit is contained in:
parent
0ad3406941
commit
6fafcd5853
18
memfile.go
18
memfile.go
|
@ -34,16 +34,18 @@ type MemDir interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type InMemoryFile struct {
|
type InMemoryFile struct {
|
||||||
sync.Mutex
|
// atomic requires 64-bit alignment for struct field access
|
||||||
at int64
|
at int64
|
||||||
name string
|
|
||||||
data []byte
|
|
||||||
memDir MemDir
|
|
||||||
dir bool
|
|
||||||
closed bool
|
|
||||||
mode os.FileMode
|
|
||||||
modtime time.Time
|
|
||||||
readDirCount int64
|
readDirCount int64
|
||||||
|
|
||||||
|
sync.Mutex
|
||||||
|
name string
|
||||||
|
data []byte
|
||||||
|
memDir MemDir
|
||||||
|
dir bool
|
||||||
|
closed bool
|
||||||
|
mode os.FileMode
|
||||||
|
modtime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func MemFileCreate(name string) *InMemoryFile {
|
func MemFileCreate(name string) *InMemoryFile {
|
||||||
|
|
Loading…
Reference in New Issue