Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

firepear/qsplit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 

Repository files navigation

qsplit

Quoted string splitting for Golang.

NB: This package is in maintenance mode. There will be no development in the forseeable future, except in response to issues/bug reports.

Qsplit turns a byte-slice into its constituent non-whitespace chunks of bytes, keeping quoted chunks together, in the manner of the shell. Mostly.

"foo bar baz"      -> [ b`foo`, b`bar`, b`baz` ]
"   foo \tbar baz" -> [ b`foo`, b`bar`, b`baz` ]
"'foo bar' baz"    -> [ b`foo bar`, b`baz` ]
"a b'cd e'f"       -> [ b`a`, b`b'cd`, b`e'f` ]

The library is tuned for speed, and the definition of quote characters is configurable.

See the package doc for more information.

News

  • 2022-07-24: qsplit shifts to mainenance mode
  • 2020-05-17: v2.5.0: Refactor of LocationsOnce; 1.1% speedup of Locations. Once now calls LocationsOnce
  • 2020-05-16: v2.4.0: Refactor for speed improvements (min 1.5%; scales with input size). Default quote set is now single and double quote
  • 2020-05-13: v2.3.1: Fix for import path after module transition
  • 2020-05-13: v2.3.0: qsplit is now a Go module

See the Release notes for all updates.

Use

go get github.com/firepear/qsplit/v2 or just import it!

About

Quoted splitting for Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages