Categorygithub.com/nikhilsbhat/common
modulepackage
0.0.5
Repository: https://github.com/nikhilsbhat/common.git
Documentation: pkg.go.dev

# README

Common Library

Go Report Card shields shields shields

Introduction

Generic functions that would be handy while building your Golang utility.

This library stands on the shoulders of various libraries built by some awesome folks.

Installation

Get the latest version of GoCD sdk using go get command.

go get github.com/nikhilsbhat/common@latest

Get specific version of the same.

go get github.com/nikhilsbhat/[email protected]

Usage

package main

import (
	"github.com/nikhilsbhat/common/renderer"
	"github.com/sirupsen/logrus"
	"log"
	"os"
)

type Object struct {
	Name string
	Date string
}

func main() {
	newObject := []Object{
		{Name: "nikhil", Date: "01-01-2024"},
		{Name: "john", Date: "01-02-2024"},
	}

	logger := logrus.New()
	render := renderer.GetRenderer(os.Stdout, logger, true, true, false, false, false)

	if err := render.Render(newObject); err != nil {
		log.Fatal(err)
	}
}

Above code should generate yaml as below:

---
- Date: 01-01-2024
  Name: nikhil
- Date: 01-02-2024
  Name: john

More example of the libraries can be found here.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
nolint:typecheck.
No description provided by the author
No description provided by the author