Enable Getwd() in wasi and add tests
Этот коммит содержится в:
родитель
039186a2a3
коммит
08d0dc0d25
3 изменённых файлов: 10 добавлений и 2 удалений
|
@ -1,4 +1,4 @@
|
||||||
// +build baremetal wasi wasm
|
// +build baremetal wasm
|
||||||
|
|
||||||
// This file emulates some file-related functions that are only available
|
// This file emulates some file-related functions that are only available
|
||||||
// under a real operating system.
|
// under a real operating system.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !baremetal,!wasi,!wasm
|
// +build !baremetal,!wasm
|
||||||
|
|
||||||
// This file assumes there is a libc available that runs on a real operating
|
// This file assumes there is a libc available that runs on a real operating
|
||||||
// system.
|
// system.
|
||||||
|
|
8
testdata/filesystem.go
предоставленный
8
testdata/filesystem.go
предоставленный
|
@ -34,4 +34,12 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Stdout.Write(data)
|
os.Stdout.Write(data)
|
||||||
|
|
||||||
|
path, err := os.Getwd()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
if path == "" {
|
||||||
|
panic("path is empty")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче