New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

ghproxy-9d2.pages.dev/nikhilsbhat/common

Package Overview
Dependencies
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghproxy-9d2.pages.dev/nikhilsbhat/common

Go Modules
Version
v0.0.5
Version published
Created
Source

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/common@v0.0.2

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.

FAQs

Package last updated on 18 Feb 2026

Related posts