utils

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 4 Imported by: 0

README

Utils

Utils is a package created for handling input in the terminal. It's similar to the input() function in Python.

Installation

You can install the package using the command below

go get github.com/inuoshios/utils
Import the package
import "github.com/inuoshios/utils"
Example
package main

import "fmt"

func main() {
    // print out my github username

    ghUsername := utils.Input("GH Username")

    fmt.Printf("Welcome %s", ghUsername)

    // Prints: Welcome {the ghUsername you inputed}
}
Contributions

PRs are accepted. You can also create a new issue if necessary.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Input

func Input(stmt string) (string, error)

Input takes in an input from a user and prints it out in the terminal

For instance if we are trying to print out a name, it can be done like this

name, err = utils.Input("Enter your name")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Your name is &s", name)

Types

This section is empty.

Jump to

Keyboard shortcuts

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