dimiro1 / banner Goto Github PK
View Code? Open in Web Editor NEWAn easy way to add useful startup banners into your Go applications
License: MIT License
An easy way to add useful startup banners into your Go applications
License: MIT License
Hello, I want to use your lib to add banner to my program, but when I trying to run your title
example, go can't find InitString
method and GoLand shows only Init
and SetLog
methods. Also, if I try to replace InitString
with Init
and convert templ
to bytes, like in your quickstart, it just don't show anything.
Strange cause I downloaded your repo now and with your repo it works, maybe cause my go 1.15 version? I see 1.11 in your go.mod
i tried this, with a banner.txt file with ascii in it.
package main
import (
"os"
"bytes"
"github.com/dimiro1/banner"
)
func main() {
// set banner
isEnabled := true
isColorEnabled := false
banner.Init(os.Stdout, isEnabled, isColorEnabled, bytes.NewBufferString("mainBanner.txt"))
Dont see anything at all.
Also is there a way to embedd the ASCII and load it ? A file with the ASCI in it, means one more thing to make sure is deployed. Not good.
Hello,
My example application has couple of command line flags which i have parsed with pflag. But whenever i use github.com/dimiro1/banner/autoload it overrides my current flags and prints below when i run my binary with -h
. I would expect instead of overriding my flags, appending to them actually.
Below is my application's expected command line flags:
$ ./main --help
Usage of ./main:
--createUserUrl string url of the user creation on Oreilly API (default "https://learning.oreilly.com/api/v1/user/")
--emailDomain string usable domain for creating trial account, it should be a valid domain (default "jentrix.com")
--length int length of the random generated username and password (default 12)
And this is the flags when i use banner, as you see, my application's flags are missing:
$ ./main --help
Usage of ./main:
-ansi
ansi colors enabled? (default true)
-banner string
banner.txt file (default "banner.txt")
-show-banner
print the banner? (default true)
I would expect something like that:
$ ./main --help
Usage of ./main:
--createUserUrl string url of the user creation on Oreilly API (default "https://learning.oreilly.com/api/v1/user/")
--emailDomain string usable domain for creating trial account, it should be a valid domain (default "jentrix.com")
--length int length of the random generated username and password (default 12)
-ansi ansi colors enabled? (default true)
-banner string banner.txt file (default "banner.txt")
-show-banner print the banner? (default true)
Same situation repeats even if i use go's default flag package instead of pflag.
Hi,
Using banner in my project with golang 15 it works perfectly for app execution but fails when trying to write tests:
"flag provided but not defined: -test.testlogfile"
this is due to flag.Parse() in autoload.go.
Is there some workaround to use the banner with newer versions of golang?
Adding txt files clutters up the codebase too much. Need to be able to generate the ASCII art in-program.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.