z.go is a collection of frequently used utility functions for Go.
- The goal of util.go is to clean out the collection of utility functions that are defined all over your multiple Go projects.
go get -u github.com/hakadoriya/z.go
Package | Summary |
---|---|
buildinfoz |
buildinfoz package provides functionality to access and manage build information of Go binaries, including version, commit hash, build time and other compilation-time metadata. |
buildz |
buildz package provides utilities for Go build process management, including package import path resolution and build configuration handling. |
bytez |
bytez package provides a comprehensive set of utilities for byte slice manipulation in Go, offering functions for conversion, comparison, transformation and efficient byte operations. |
cliz |
cliz package provides a framework for building command-line interfaces in Go, featuring command hierarchy, option parsing, bash/zsh completion support, and standardized CLI structure management. |
contextz |
contextz package provides utilities for working with context.Context, including context creation, manipulation, and management of context values and cancellation. |
databasez/sqlz |
sqlz package provides enhanced utilities for Go's database/sql package, offering simplified database operations, connection management, and query execution helpers. |
diffz |
diffz package provides utilities for comparing and finding differences between data structures, supporting various comparison algorithms and diff output formats. |
envz |
envz package provides a structured approach to environment variable management, featuring struct tag-based configuration and automatic environment variable parsing and validation. |
errorz |
errorz package provides enhanced error handling utilities, including stack trace generation, error wrapping, and custom error type creation with detailed error context. |
genericz |
genericz package provides utility functions and types for working with Go generics, offering common generic algorithms and data structure operations. |
grpcz/grpclogz |
grpclogz package provides logging utilities specifically designed for gRPC operations, integrating with Google's gRPC logging system for enhanced logging capabilities. |
logz/slogz |
slogz package provides utilities for working with Go's log/slog package, offering enhanced logging functionality, custom formatters, and logging middleware. |
mapz |
mapz package provides utilities for map operations in Go, including safe concurrent access, map manipulation, and helper functions for common map operations. |
mustz |
mustz package provides utility functions that convert error-returning functions into panic-on-error versions, useful for situations where errors are not expected or should be fatal. |
otelz |
otelz package provides utilities for OpenTelemetry integration in Go applications, offering simplified setup for tracing, metrics, and observability with automatic exporters. |
otelz/tracez |
package tracez provides a some utilities for OpenTelemetry Trace. |
pathz/filepathz |
filepathz package provides utilities for file path manipulation and filesystem operations, extending Go's path/filepath package with additional functionality. |
reflectz |
reflectz package provides utilities for working with Go's reflect package, offering simplified reflection operations and type manipulation functions. |
retryz |
retryz package provides utilities for implementing retry mechanisms, including configurable retry strategies, backoff algorithms, and error handling for retryable operations. |
runtimez |
runtimez package provides utilities for runtime information and manipulation, including function name resolution, stack trace analysis, and runtime debugging helpers. |
slicez |
slicez package provides utilities for slice operations in Go, offering functions for manipulation, transformation, and common slice algorithms. |
stringz |
stringz package provides utilities for string manipulation and processing, offering enhanced string operations beyond the standard library's capabilities. |
syncz |
syncz package provides utilities for synchronization primitives and concurrent programming patterns, extending Go's sync package functionality. |
testingz/assertz |
assertz package is a wrapper around testing.TB to provide more helpful functions for testing. assertz.* functions are similar to (testing.TB).Error functions. |
testingz |
testingz package provides enhanced testing utilities for Go, including custom assertions, test helpers, and mock implementations for common interfaces like io.Reader and io.Writer. |
testingz/requirez |
requirez package is a wrapper around testing.TB to provide more helpful functions for testing. requirez.* functions are similar to (testing.TB).Fatal functions. |
xz/toolz/importz |
importz package provides utilities for managing Go imports using golang.org/x/tools/imports, offering functions for import formatting and organization. |