mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-23 20:02:22 +00:00
Fix code error in ch1-04
This commit is contained in:
parent
b4702b2f65
commit
51e1de4a7c
@ -245,13 +245,13 @@ f, _ := OpenFile("foo.dat")
|
|||||||
|
|
||||||
// 绑定到了 f 对象
|
// 绑定到了 f 对象
|
||||||
// func Close() error
|
// func Close() error
|
||||||
var Close = func Close() error {
|
var Close = func() error {
|
||||||
return (*File).Close(f)
|
return (*File).Close(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 绑定到了 f 对象
|
// 绑定到了 f 对象
|
||||||
// func Read(offset int64, data []byte) int
|
// func Read(offset int64, data []byte) int
|
||||||
var Read = func Read(offset int64, data []byte) int {
|
var Read = func(offset int64, data []byte) int {
|
||||||
return (*File).Read(f, offset, data)
|
return (*File).Read(f, offset, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user