errnov1

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 0 Imported by: 0

README

ERRNO

C-like err codes providable module

Go Reference Go Report Card

About

C-like err codes providable module

Installation

go get github.com/rejchev/errno

Usage mapped opts

import (
	"context"

	errnov1 "github.com/rejchev/errno"
)

func main() {

	buff := []byte{} 
	if code := read(&buff); FAIL(code) {
		panic(code.String())
	}

}

func read(buff *[]byte) errnov1.Code {
	if buff == nil {
		return errnov1.EINVAL
	}

	// do something ...

	return errnov1.OK
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FAIL

func FAIL(v Code) bool

func SUCCESS

func SUCCESS(v Code) bool

Types

type Code

type Code int
const (
	OK Code = 0 // Success

	// Basic err codes
	EPERM   Code = 1  // Operation not permitted
	ENOENT  Code = 2  // No such file or directory
	ESRCH   Code = 3  // No such process
	EINTR   Code = 4  // Interrupted system call
	EIO     Code = 5  // I/O error
	ENXIO   Code = 6  // No such device or address
	E2BIG   Code = 7  // Argument list too long
	ENOEXEC Code = 8  // Exec format error
	EBADF   Code = 9  // Bad file number
	ECHILD  Code = 10 // No child processes
	EAGAIN  Code = 11 // Try again
	ENOMEM  Code = 12 // Out of memory
	EACCES  Code = 13 // Permission denied
	EFAULT  Code = 14 // Bad address
	ENOTBLK Code = 15 // Block device required
	EBUSY   Code = 16 // Device or resource busy
	EEXIST  Code = 17 // File exists
	EXDEV   Code = 18 // Cross-device link
	ENODEV  Code = 19 // No such device
	ENOTDIR Code = 20 // Not a directory
	EISDIR  Code = 21 // Is a directory
	EINVAL  Code = 22 // Invalid argument
	ENFILE  Code = 23 // File table overflow
	EMFILE  Code = 24 // Too many open files
	ENOTTY  Code = 25 // Not a typewriter
	ETXTBSY Code = 26 // Text file busy
	EFBIG   Code = 27 // File too large
	ENOSPC  Code = 28 // No space left on device
	ESPIPE  Code = 29 // Illegal seek
	EROFS   Code = 30 // Read-only file system
	EMLINK  Code = 31 // Too many links
	EPIPE   Code = 32 // Broken pipe
	EDOM    Code = 33 // Math argument out of domain
	ERANGE  Code = 34 // Math result not representable

	// Additional err codes
	EDEADLK      Code = 35 // Resource deadlock avoided
	ENAMETOOLONG Code = 36 // File name too long
	ENOLCK       Code = 37 // No locks available
	ENOSYS       Code = 38 // Function not implemented
	ENOTEMPTY    Code = 39 // Directory not empty
	ELOOP        Code = 40 // Too many symbolic links
	ENOMSG       Code = 42 // No message of desired type
	EIDRM        Code = 43 // Identifier removed
	ENOTFOUND    Code = 44 // Not found

	// Specific err codes
	ECOMP   Code = 70 // Component error
	EENTITY Code = 71 // Entity error
	ESYSTEM Code = 72 // System error
	ECALL   Code = 73 // Call error
)

func (Code) Int

func (x Code) Int() int

func (Code) String

func (x Code) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL