Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mingrammer/cfmt
:art: Contextual fmt inspired by bootstrap color classes
https://github.com/mingrammer/cfmt
bootstrap contextual fmt go
Last synced: 3 months ago
JSON representation
:art: Contextual fmt inspired by bootstrap color classes
- Host: GitHub
- URL: https://github.com/mingrammer/cfmt
- Owner: mingrammer
- License: mit
- Created: 2018-03-15T19:04:27.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-07T17:31:52.000Z (about 6 years ago)
- Last Synced: 2024-07-31T20:38:29.807Z (6 months ago)
- Topics: bootstrap, contextual, fmt, go
- Language: Go
- Homepage:
- Size: 38.1 KB
- Stars: 102
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - cfmt - Contextual fmt inspired by bootstrap color classes. (Command Line / Advanced Console UIs)
- fucking-awesome-go - cfmt - Contextual fmt inspired by bootstrap color classes. (Command Line / Advanced Console UIs)
- awesome-go - cfmt - Contextual fmt inspired by bootstrap color classes. (Command Line / Advanced Console UIs)
- awesome-list - cfmt
- awesome-go - cfmt - Contextual fmt inspired by bootstrap color classes. (Command Line / Advanced Console UIs)
- awesome-go - cfmt - Contextual fmt inspired by bootstrap color classes - ★ 45 (Command Line)
- awesome-go-extra - cfmt - 03-15T19:04:27Z|2018-12-07T17:31:52Z| (Build Automation / Advanced Console UIs)
- awesome-go-with-stars - cfmt - Contextual fmt inspired by bootstrap color classes. (Command Line / Advanced Console UIs)
- awesome-go-plus - cfmt - Contextual fmt inspired by bootstrap color classes. ![stars](https://img.shields.io/badge/stars-104-blue) (Command Line / Advanced Console UIs)
- awesome-go-cn - cfmt
- awesome-go-plus - cfmt - Contextual fmt inspired by bootstrap color classes. ![stars](https://img.shields.io/badge/stars-103-blue) ![forks](https://img.shields.io/badge/forks-7-blue) (Command Line / Advanced Console UIs)
README
Cfmt
Contextual fmt
It provides contextual formatting functions that have nearly identical usage of the fmt package. The ideas were borrowed from bootstrap's contextual color classes.
## Installation
```
go get github.com/mingrammer/cfmt
```## Usage
```go
package mainimport (
"log""github.com/mingrammer/cfmt"
)func main() {
cfmt.Success("User was created successfully")
cfmt.Infoln("Here are some candidates")
cfmt.Warningf("%s is not valid integer value\n", "123a")
log.Fatal(cfmt.Serrorf("Only numeric is allowed, got %s", "123.456a"))
}
```![cfmt output](images/output.png)
## Contextual functions
> Note: cfmt.Errorf function does not do same things to fmt.Errorf, but to fmt.Printf with red colored text.
- Success (Green)
- Fsuccess, Fsuccessf, Fsuccessln
- Success, Successf, Successln
- Ssuccess, Ssuccessf, Ssuccessln
- Info (Cyan)
- Finfo, Finfof, Finfoln
- Info, Infof, Infoln
- Sinfo, Sinfof, Sinfoln
- Warning (Yellow)
- Fwarning, Fwarningf, Fwarningln
- Warning, Warningf, Warningln
- Swarning, Swarningf, Swarningln
- Error (Red)
- Ferror, Ferrorf, Ferrorln
- Error, Errorf, Errorln
- Serror, Serrorf, Serrorln## License
MIT