// Copyright 2016 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.//go:build !windowspackage testenvimport ()func hasSymlink() ( bool, string) {switchruntime.GOOS {case"plan9":returnfalse, ""case"android", "wasip1":// For wasip1, some runtimes forbid absolute symlinks, // or symlinks that escape the current working directory. // Perform a simple test to see whether the runtime // supports symlinks or not. If we get a permission // error, the runtime does not support symlinks. , := os.MkdirTemp("", "")if != nil {returnfalse, "" }deferfunc() { _ = os.RemoveAll() }() := filepath.Join(, "testfile.txt")if := os.WriteFile(, nil, 0644); != nil {returnfalse, "" }if := os.Symlink(, filepath.Join(, "testlink")); != nil {ifSyscallIsNotSupported() {returnfalse, fmt.Sprintf("symlinks unsupported: %s", .Error()) }returnfalse, "" } }returntrue, ""}
The pages are generated with Goldsv0.7.0-preview. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.