fix for ci/cd

This commit is contained in:
Cytown
2026-03-23 18:15:16 +08:00
parent 4e3769e989
commit d77375721a
6 changed files with 4 additions and 51 deletions
+3 -2
View File
@@ -1,5 +1,4 @@
//go:build !windows
// +build !windows
package logger
@@ -7,6 +6,8 @@ import (
"fmt"
"io"
"os"
"golang.org/x/sys/unix"
)
func initPanicFile(panicFile string) io.WriteCloser {
@@ -14,7 +15,7 @@ func initPanicFile(panicFile string) io.WriteCloser {
if err != nil {
panic(fmt.Sprintf("error in open panic: %v", err))
}
if err = Dup2(int(file.Fd()), int(os.Stderr.Fd())); err != nil {
if err = unix.Dup2(int(file.Fd()), int(os.Stderr.Fd())); err != nil {
panic(fmt.Sprintf("error in syscall.Dup2: %v", err))
}
return file
-12
View File
@@ -1,12 +0,0 @@
//go:build linux && amd64
// +build linux,amd64
package logger
import (
"syscall"
)
func Dup2(oldfd int, newfd int) error {
return syscall.Dup2(oldfd, newfd)
}
-12
View File
@@ -1,12 +0,0 @@
//go:build linux && arm64
// +build linux,arm64
package logger
import (
"syscall"
)
func Dup2(oldfd int, newfd int) error {
return syscall.Dup3(oldfd, newfd, 0)
}
-12
View File
@@ -1,12 +0,0 @@
//go:build darwin
// +build darwin
package logger
import (
"syscall"
)
func Dup2(oldfd int, newfd int) error {
return syscall.Dup2(oldfd, newfd)
}
-12
View File
@@ -1,12 +0,0 @@
//go:build linux && loong64
// +build linux,loong64
package logger
import (
"syscall"
)
func Dup2(oldfd int, newfd int) error {
return syscall.Dup3(oldfd, newfd, 0)
}