util

package module
v0.0.0-...-2c030c4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package util includes utility/helper functions that may be useful to other modules.

  • Copyright (C) 2023 Intel Corporation
  • SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsPath

func AbsPath(path string) (string, error)

AbsPath returns absolute path after expanding '~' to user's home dir Useful when application is started by a process that isn't a shell, e.g. PKB Use everywhere in place of filepath.Abs()

func DirectoryExists

func DirectoryExists(path string) (exists bool, err error)

DirectoryExists returns whether the given directory (not a file) exists

func ExpandUser

func ExpandUser(path string) string

ExpandUser expands '~' to user's home directory, if found, otherwise returns original path

func FileExists

func FileExists(path string) (exists bool, err error)

FileExists returns whether the given file (not a directory) exists

func StringInList

func StringInList(s string, l []string) bool

StringInList confirms if string is in list of strings

func StringIndexInList

func StringIndexInList(s string, l []string) (idx int, err error)

StringIndexInList returns the index of the given string in the given list of strings and error if not found

Types

This section is empty.

Jump to

Keyboard shortcuts

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