utils

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 7 Imported by: 4

Documentation

Overview

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2021-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(srcpath, dstpath string) (err error)

Copy copies the contents of the file at srcpath to a regular file at dstpath. If dstpath already exists and is not a directory, the function truncates it. The function does not copy file modes or file attributes.

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory exists.

func IsDir

func IsDir(path string) (bool, error)
func IsLink(path string) (bool, error)

func KeyInList

func KeyInList(key string, arr *[]string) bool

func OsRelease

func OsRelease() (string, error)

func TryResolveBinaryAbsPath added in v0.8.0

func TryResolveBinaryAbsPath(b string) string

Try to resolve the abs path of the passed param Return itself if the binary is not present in the default paths (/sbin, /bin, /usr/sbin, /usr/bin)

Types

type NopCloseWriter added in v0.7.0

type NopCloseWriter struct {
	*bytes.Buffer
}

func NewNopCloseWriter added in v0.7.0

func NewNopCloseWriter(buf *bytes.Buffer) *NopCloseWriter

func (*NopCloseWriter) Close added in v0.7.0

func (ncw *NopCloseWriter) Close() error

Jump to

Keyboard shortcuts

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