stringutils

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 2 Imported by: 1

README

Version Test Go Documentation Go Report Card

stringutils

A basic golang package for demonstration purpose. Package currently contains only one function:

func Reverse(s string) (string, error)

Installation

Go to your project root, where go.mod file exists, than grab the library via:

go get github.com/vigo/stringutils-demo@latest

Usage

package main

import (
	"fmt"

	"github.com/vigo/stringutils-demo"
)

func main(){
	reversed, err := stringutils.Reverse("vigo")
	if err != nil {
		log.Fatal(err)
	}    
	fmt.Println(reversed) // ogiv
}

Makefile

make help

Commands usage:

make <command>

commands:

test       run tests
testfuzz   run tests with fuzz (30 seconds)
bench      run benchmark tests
doc        run godoc server at 3000 unless PORT env-var is set
  • make test: Runs tests
  • make testfuzz: Runs Fuzzy tests for 30seconds (go 1.18)
  • make bench: Runs benchmark tests
  • make doc: Runs godoc server on port 3000. Use PORT environment variable for different port -> PORT=4000 make doc

Contributor(s)


Contribute

All PR’s are welcome!

  1. fork (https://github.com/vigo/stringutils-demo/fork)
  2. Create your branch (git checkout -b my-feature)
  3. commit yours (git commit -am 'add some functionality')
  4. push your branch (git push origin my-feature)
  5. Than create a new Pull Request!

License

This project is licensed under MIT


This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Documentation

Overview

Package stringutils implements basic string utility functions for demo purposes only!

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrInvalidUTF8 = errors.New("input is not a valid UTF-8")

Functions

func Reverse

func Reverse(s string) (string, error)

Reverse reverses given string!

Example
r, _ := stringutils.Reverse("vigo")
fmt.Println(r)
Output:

ogiv

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL