/gosplash

Go library to make initial log lines at a program start time

Primary LanguageGoMIT LicenseMIT

GoSplash

Library to show log lines at the start of a program

Build status

Last release GitHub last release date Commits since release

GitHub last commit GitHub commit activity GitHub closed PRs GitHub issues GitHub closed issues

Lines of code Code size GitHub repo size Go version

MIT Visitors count

==================================================
==================================================
==================== gosplash ====================
==================================================
================ Made with ❤️ by =================
============ https://github.com/qdm12 ============
==================================================
==================================================

Running version v1.1.1 built on 2021-07-14 (commit c892ef2)

📣 hello world

🔧 Need help? https://github.com/qdm12/gosplash/discussions/new
🐛 Bug? https://github.com/qdm12/gosplash/issues/new
✨ New feature? https://github.com/qdm12/gosplash/issues/new
☕ Discussion? https://github.com/qdm12/gosplash/discussions/new
💻 Email? quentin.mcgaw@gmail.com
💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12

Features

  • Tailored towards Github repositories for now, create an issue if you need something

  • Wide range of optional settings available:

    type Settings struct {
      // Formatting settings
      Format       Format // defaults to DefaultFormat
      LineLength   int    // defaults to 40
      Separator    rune   // defaults to '='
      MadeByPrefix string // defaults to "Made with ❤️  by "
    
      // Project information
      RootURL    string // defaults to https://github.com
      User       string
      Repository string
      Authors    []string // defaults to [RootURL + "/" + User]
      Emails     []string
    
      // Program information
      Version      string // defaults to "unknown"
      Commit       string // defaults to "unknown"
      BuildDate    string // defaults to "unknown date"
      Announcement string
      AnnounceExp  time.Time // leave to zero value to disable expiration
    
      // Sponsor information
      PaypalUser    string
      GithubSponsor string
    }
  • Support for emojis

  • 100% test coverage

Setup

go get github.com/qdm12/gosplash

From the example:

package main

import (
    "fmt"
    "strings"

    "github.com/qdm12/gosplash"
)

var (
    // should be set by your CI using -ldflags
    version   = "v0.1.0"
    commit    = "c892ef2"
    buildDate = "2021-07-14"
)

func main() {
    lines := gosplash.MakeLines(gosplash.Settings{
        User:          "qdm12",
        Repository:    "gosplash",
        Version:       version,
        Commit:        commit,
        BuildDate:     buildDate,
        Announcement:  "new feature 🎉",
        PaypalUser:    "qmcgaw",
        GithubSponsor: "qdm12",
    })

    fmt.Println(strings.Join(lines, "\n"))
}

Quick links

Ports