GoScanLine – Open-Source CLI Input Helper for Go

Fahim

Fahim Wayez

GoScanLine – Open-Source CLI Input Helper for Go

I built and published GoScanLine, a lightweight Go package that simplifies taking multi-word input from the command line. In raw Go, 'fmt.Scanln' stops at the first space, forcing developers to write extra boilerplate with 'bufio.Reader'. GoScanLine abstracts this into a simple, reusable function for full-line input. The package is live on pkg.go.dev and available for developers worldwide, demonstrating my ability to identify developer pain points and ship clean, reusable open-source tools.

Role

Go Developer | Open-Source Maintainer

Features

Reads a full line of input from stdin (keeps spaces, trims newline)
Works out of the box — no need for extra boilerplate with bufio.Reader
Supports typed destinations (string, bool, int, float, etc.)
Includes cancellable reads for better CLI UX
Handles no-echo secrets (like password input) securely
Sends prompts to stderr so stdout stays clean for piping
Minimal & dependency-free — just import and use
Published on pkg.go.dev with MIT license for easy adoption

Tech Stack

Golang
Before (left) and after (right) comparison
Before (left) and after (right) comparison

GoScanLine – Open-Source CLI Input Helper for Go

Like this project

Posted Sep 8, 2025

Developed GoScanLine, an open source CLI input helper package for Go.