util

package
v0.0.0-...-55976a8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(i int) int

func FileError

func FileError(err error)

func ReadFile

func ReadFile(f string) ([]string, error)

ReadFile reads lines of text file f into slices of strings. It returns any error it encounters.

func ReadLine

func ReadLine(f string) (string, error)

readLine reads the text file f and flattens it as a single string. It returns any error it encounters.

func ReadSpaceSeparatedFileToInt

func ReadSpaceSeparatedFileToInt(input string) ([][]int, error)

ReadSpaceSeparatedFileToInt reads the text file `input` to a matrix of integers. It returns any error it encounters.

func ReadSpaceSeparatedFileToStr

func ReadSpaceSeparatedFileToStr(input string) ([][]string, error)

ReadSpaceSeparatedFileToStr reads the text file `input` to a matrix of strings. It returns any error it encounters.

func RemoveElementInSlice

func RemoveElementInSlice(slice []int, i int) []int

RemoveElementInSlice returns a new slice with the element at index i removed, without modifying the original slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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