This package includes various utilities and extensions for your Go code.

Go utilities

Tests

This package includes various utilities and extensions for your Go code.

Inspired by lodash

Install

go get github.com/murat/go-utils@master

Usage

String extensions

package main

import (
	"fmt"

	"github.com/murat/go-utils/strings"
)

func main() {
	// Capitalize
	fmt.Println(strings.Capitalize("hello world")) // Hello World
	// CamelCase
	fmt.Println(strings.ToCamelCase("hello world")) // helloWorld
	// SnakeCase
	fmt.Println(strings.ToSnakeCase("hello world")) // hello_world
	// Deburr
	fmt.Println(strings.Deburr("éàèù")) // eaeu
	// KebabCase
	fmt.Println(strings.ToKebabCase("hello world")) // hello-world
	// Paddings
	fmt.Println("|" + strings.Pad("hello", 20) + "|")   // |       hello        |
	fmt.Println(strings.PadWith("hello", 20, "-"))      // |-------hello--------|
	fmt.Println(strings.PadLeft("hello", 20))           // |               hello|
	fmt.Println(strings.PadLeftWith("hello", 20, "-"))  // |---------------hello|
	fmt.Println(strings.PadRight("hello", 20))          // |hello               |
	fmt.Println(strings.PadRightWith("hello", 20, "-")) // |hello---------------|
}

Contribute

All contributors are welcome to contribute to this project.

Cheers 🍺

Similar Resources

A simple api built in Go that facilitates directly sending email from your client side html to your inbox

go-email-service A simple api built in Go that facilitates directly sending emai

Dec 28, 2021

Bitfield - A collection of code samples, listings, and solutions to challenges from the book For the Love of Go

Bitfield - A collection of code samples, listings, and solutions to challenges from the book For the Love of Go

For the Love of Go - code listings This is a collection of code samples, listing

Jan 10, 2022

"there" also called "GoThere" aims to be a simple Go Library to reduce redundant code for REST APIs.

there "there" also called "GoThere" aims to be a simple Go Library to reduce redundant code for REST APIs. Despite the existence of the other librarie

Dec 25, 2022

A compute service that lets you run code without provisioning or managing servers

AWS Lambda for Go Lambda is a compute service that lets you run code without provisioning or managing servers. Lambda runs your code on a high-availab

Oct 13, 2021

Pulumi - Modern Infrastructure as Code. Any cloud, any language 🚀

Pulumi - Modern Infrastructure as Code. Any cloud, any language 🚀

Pulumi's Infrastructure as Code SDK is the easiest way to create and deploy cloud software that use containers, serverless functions, hosted services,

Dec 30, 2022

Go client library for efficient postal code lookup (powered by GeoNames)

go-poco Client library for efficient postal code lookup (powered by GeoNames) Installation go-poco may be installed using the go get command: go get g

Dec 23, 2021

Fetch input data for Advent of Code challenges.

Import the inputs for Advent of Code challenges straight into your code. Fetched data is cached by default. Usage Log into Advent of Code from your br

Oct 12, 2022

Us-api: a simple service that returns the US state code based on the state

us-api us-api is a simple service that returns the US state code based on the state. It does not support creating, updating nor deleting data. Local D

Dec 13, 2021
Simple AWS utilities packaged as a standalone binary

AWS Utils This repository contains a simple CLI utility with a number of useful sub-commands implemented for working with AWS Installation If you the

Oct 11, 2022
GitHub Utilities for managing classroom repositories.

ghutil GitHub Utilities for bulk operations. Requirements A ghutil.toml configuration file is needed in the working directory. It should have entries

Dec 21, 2021
Api shows various data from the countries of the world

Microservice API Enza Enza API tem como objectivo apresentar informações dos Paises por Continentes . Informações como : Nome do Pais Bandeira Mapa Ca

Nov 26, 2021
Use grype to do Docker layer scanning on various AWS ECR repositories

grype-scan-aws-ecr Use https://github.com/anchore/grype/ to do Docker layer scanning on various AWS ECR repositories. kubectl get pods -o custom-colum

Jan 6, 2022
Simple-api - Create Simple `Hello World` APIs from Various Programming Languages

simple-api Create Simple `Hello World` APIs from Various Programming Languages.

Jan 18, 2022
🎼 This library provides an API to search for lyrics from various providers in China.

LYRIC-GO This library provides an API to search for lyrics from various providers in China. Supported Providers KuGou Music QQ Music Netease Music Usa

May 24, 2022
An unofficial package in Golang to help developers implement ZATCA (Fatoora) QR code easily.

Zatca SDK GO An unofficial package in Golang to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing ✅ The hash

Jan 1, 2023
Elastos.ELA.Rosetta.API - How to write a Rosetta server and use either the Client package or Fetcher package to communicate

Examples This folder demonstrates how to write a Rosetta server and how to use e

Jan 17, 2022
Go package providing opinionated tools and methods for working with the `aws-sdk-go/service/cloudfront` package.

go-aws-cloudfront Go package providing opinionated tools and methods for working with the aws-sdk-go/service/cloudfront package. Documentation Tools $

Feb 2, 2022
It is a package and command line application that provides you to store encrypted credentials/secrets in your repository.

sypher[ ⚠️ Work in progress] sypher provides you to store your credentials and secrets as encrypted in your repository. Usage Install the command line

Feb 23, 2022