1
0
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:
Alex Nguyen 2019-06-26 14:21:39 +07:00 committed by GitHub
parent b4702b2f65
commit 51e1de4a7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -245,13 +245,13 @@ f, _ := OpenFile("foo.dat")
// 绑定到了 f 对象
// func Close() error
var Close = func Close() error {
var Close = func() error {
return (*File).Close(f)
}
// 绑定到了 f 对象
// 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)
}