go.rice打包试用了一下,很方便,拿到winxp上运行失败

panic: Failed to find GetFileInformationByHandleEx procedure in kernel32.dll: The specified procedure could not be found.

goroutine 1 [running]:
syscall.(*LazyProc).mustFind(0x11c3d8c0)
        d:/go/src/syscall/dll_windows.go:311 +0x42
syscall.(*LazyProc).Addr(0x11c3d8c0, 0xcf00c0)
        d:/go/src/syscall/dll_windows.go:318 +0x21
internal/syscall/windows.GetFileInformationByHandleEx(0x784, 0x9, 0x11c6be8c, 0x8, 0x3, 0x11c1b348)
        d:/go/src/internal/syscall/windows/zsyscall_windows.go:385 +0x27
os.newFileStatFromGetFileInformationByHandle(0x11c4a2f0, 0xd, 0x784, 0x0, 0x11c4a2f0, 0xd)
        d:/go/src/os/types_windows.go:52 +0x135
os.(*File).Stat(0x11c3a660, 0xd, 0x0, 0x0, 0x11c3a660)
        d:/go/src/os/stat_windows.go:55 +0x133
github.com/daaku/go%2ezipexe.OpenCloser(0x11c4a2f0, 0xd, 0x11c4a2f0, 0xd, 0x0, 0x0, 0x0)
        D:/GoWork/src/github.com/daaku/go.zipexe/zipexe.go:26 +0x5e
github.com/GeertJohan/go%2erice.init.0()
        D:/GoWork/src/github.com/GeertJohan/go.rice/appended.go:41 +0x6f

经查在winxp上不支持GetFileInformationByHandleEx,只支持GetFileInformationByHandle,我还想升级一下kernel32.dll来支持这个函数,后来发现是不行的。

最终找到的原因还是go取消了对xp的支持。

Windows XP support was officially removed in Go 1.11 (aug 2018), however things continued to mostly work, apparently. Now we are building with Go 1.12 and things don't.

Windows XP is not supported by the Go runtime, support starts with Windows 7. We (as a project) don't have the resources to support it, sorry about that.