Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Libraries that enhance your Go code

License

NotificationsYou must be signed in to change notification settings

nikhilsbhat/common

Repository files navigation

Go Report Cardshieldsshieldsshields

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 usinggo 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 mainimport ("github.com/nikhilsbhat/common/renderer""github.com/sirupsen/logrus""log""os")typeObjectstruct {NamestringDatestring}funcmain() {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)iferr:=render.Render(newObject);err!=nil {log.Fatal(err)}}

Above code should generate yaml as below:

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

More example of the libraries can be foundhere.


[8]ページ先頭

©2009-2025 Movatter.jp