Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 591 Bytes

SyscallError_Error.md

File metadata and controls

36 lines (24 loc) · 591 Bytes

func (e *SyscallError) Error() string

参数列表

返回值:

  • 返回string 返回SyscallError的字符串形式

功能说明:

这个函数主要是获取SyscallError的字符串形式

代码实例:

package main

import (
    "errors"
    "fmt"
    "os"
)

func main() {
    se := &os.SyscallError{
        Syscall: "/xx",
        Err:     errors.New("Syscall Error!"),
    }
    fmt.Printf("%s\n", se.Error())
}

代码输出:

//test in ArchLinux
/xx: Syscall Error!