https://github.com/ghosind/formatparser
Parse format strings.
https://github.com/ghosind/formatparser
formatter parser
Last synced: about 1 month ago
JSON representation
Parse format strings.
- Host: GitHub
- URL: https://github.com/ghosind/formatparser
- Owner: ghosind
- License: mit
- Created: 2022-02-26T15:23:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-26T16:34:16.000Z (about 3 years ago)
- Last Synced: 2024-12-23T11:44:10.077Z (5 months ago)
- Topics: formatter, parser
- Language: Go
- Homepage: https://pkg.go.dev/github.com/ghosind/formatparser
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# formatparser

[](https://www.codacy.com/gh/ghosind/formatparser/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ghosind/formatparser&utm_campaign=Badge_Grade)


[](https://pkg.go.dev/github.com/ghosind/formatparser)Parse format string to text token part or key token part arrays.
## Installation
```sh
go get -u github.com/ghosind/formatparser
```## Getting Started
```go
package mainimport (
"log""github.com/ghosind/formatparser"
)func main() {
format := "[%time] %message"parts := formatparser.Parse(format)
for _, part := range parts {
log.Println(part)
}
}
``````sh
$ go run app.go
&{1 [}
&{2 time}
&{1 ] }
&{2 %message}
```