https://github.com/evandrojr/string-interpolation
Simple string interpolation for golang
https://github.com/evandrojr/string-interpolation
go golang interpolation simple string string-manipulation stringformatter
Last synced: about 1 month ago
JSON representation
Simple string interpolation for golang
- Host: GitHub
- URL: https://github.com/evandrojr/string-interpolation
- Owner: evandrojr
- License: mit
- Created: 2022-11-19T21:01:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-19T22:25:54.000Z (over 3 years ago)
- Last Synced: 2024-06-20T13:36:31.113Z (almost 2 years ago)
- Topics: go, golang, interpolation, simple, string, string-manipulation, stringformatter
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# String interpolation in Go finally made easy...
Simple string interpolation for golang. Interpolates anything in an easy way.
No need to pass the format parameters %d, %s, %t... anymore!
## Installation
```
go get github.com/evandrojr/string-interpolation
```
## Usage
```
package main
import (
"github.com/evandrojr/string-interpolation/esi"
)
func main() {
esi.Print("Print ", 10, " ", 7, " interpolates anything ", true, " ", 3.4e10)
esi.Print(" no line break")
esi.Println()
esi.Println("Println ", 10, " ", 7, " interpolates anything ", true, " ", 3.4e10)
f := esi.Sprint("Sprint ", 10, " ", 7, " interpolates anything ", true, " ", 3.4e10)
esi.Print(f)
}
```
### Output
```
Print 10 7 interpolates anything true 3.4e+10 no line break
Println 10 7 interpolates anything true 3.4e+10
Sprint 10 7 interpolates anything true 3.4e+10%
```