Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jcbhmr/go-anstyle/anstyle

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jcbhmr/go-anstyle/anstyle

  • v0.0.0-20240618215844-4e6f54b3c4d4
  • Source
  • Go
  • Socket score

Version published
Created
Source

anstyle for Go

🦀 Rust anstyle crate ported to Go

style := anstyle.NewStyle().
    Bold().
    Underline().
    Foreground(anstyle.ANSIColorRed)
fmt.Printf("%vHello world!%v\n", style, style.RenderReset())

image
See the example

Installation

Go

go get github.com/jcbhmr/go-anstyle/anstyle

Usage

Go Terminal

style := anstyle.NewStyle().
    Bold().
    Underline().
    Foreground(anstyle.ANSIColorRed)
fmt.Printf("%vHello world!%v\n", style, style.RenderReset())

Development

Go

To get started after cloning this repository you can run the example:

go run ./examples/dump-style.go

This project tries to bring some of the Rust-isms from the anstyle crate to Go. That means things like Option<T> are represented as *T or (T, bool) and Result<T, E> is (T, error). I don't really know if that's the best way to represent these things in Go, but it's what I'm doing for now. If you have better ideas or suggestions, please tell me! ❤️

FAQs

Package last updated on 18 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc