go

module
v0.0.0-...-9fbc4cb Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT

README

go

Handy Go libraries and utilities

This repository contains a grab‑bag of small, focused Go packages that I use across projects:

  • pkg/stringz: helpers for working with strings (e.g. ToAlphaNumeric).
  • pkg/structs: high‑level helpers for turning structs into maps/slices and inspecting fields.
  • pkg/command: utilities for conditionally running exec.Cmd instances (honouring a DRY_RUN env var).
  • pkg/httpx: helpers for dealing with HTTP responses and errors.
  • pkg/logz, pkg/jsonx, pkg/jsontime, pkg/filez, pkg/slicez, pkg/mathx, pkg/reflectx, etc: small, composable helpers for common tasks.

For full package documentation, see the Go reference for the module: pkg.go.dev/github.com/tartale/go.

Installation

Add the module to your project using go get:

go get github.com/tartale/go@latest

Or depend on a specific sub‑package:

go get github.com/tartale/go/pkg/stringz@latest

Quick example

Using stringz and structs together:

package main

import (
	"fmt"

	"github.com/tartale/go/pkg/stringz"
	"github.com/tartale/go/pkg/structs"
)

type User struct {
	Name  string `structs:"name"`
	Email string `structs:"email,omitempty"`
}

func main() {
	fmt.Println(stringz.ToAlphaNumeric("Hello, world!")) // "Helloworld"

	u := User{Name: "Tom", Email: "[email protected]"}
	m := structs.Map(u)
	fmt.Printf("%#v\n", m)
}

Development

  • Tests: run all tests with go test ./....
  • Packages: see pkg/ for the collection of small, focused libraries.

Directories

Path Synopsis
pkg
Package pkg The sub-packages of 'pkg' are a basic extensions to the existing golang 'pkg' package, adding useful functions that I (and hopefully you?) think should already be present there.
Package pkg The sub-packages of 'pkg' are a basic extensions to the existing golang 'pkg' package, adding useful functions that I (and hopefully you?) think should already be present there.
errorx
Package errorx Copyright 2019 Tom Artale.
Package errorx Copyright 2019 Tom Artale.
slicez
Package slicez provides helpers for working with slices.
Package slicez provides helpers for working with slices.
stringz
Package stringz provides helpers for working with strings.
Package stringz provides helpers for working with strings.
structs
Package structs contains various utilities functions to work with structs.
Package structs contains various utilities functions to work with structs.
tools
go-render command
go-render/cmd
Package cmd /*
Package cmd /*

Jump to

Keyboard shortcuts

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