module
Version:
v6.2.1
Opens a new window with list of versions in this module.
Published: Oct 27, 2021
License: MIT
Opens a new window with license information.
README
¶
go-packagex
Extra helpers for Go (Go 1.16+).
Import path:
import "github.com/mgenware/go-packagex/v6/<sub_package>"
Packages
strconvx
Overview:
- Quick
ParseXXX
functions without base
or bitSize
parameters.
stringsx
Overview:
SubString
for Unicode chars(rune
), SubStringFromStart
, SubStringToEnd
.
Truncate
.
mathx
Overview:
Min
, Max
for int
, int64
, uint
, uint64
and byte
types.
Abs
for int
and int64
.
slicex
Overview:
- Check for deep equality for slices (types supported:
byte
, int
, uint
, int64
, uint64
).
iox
Overview:
- Read text file.
- Check if a file/directory exists.
httpx
Overview:
- Set HTTP response
Content-Type
to common MIME types or from an file extension.
dbx
Overview:
- Helper function to start a database transaction.
- Convert
Result.LastInsertId
to uint64
, int
, uint
.
- Convert
Result.RowsAffected
to uint64
, int
, uint
.
- Limit number of rows affected.
- Common interface definition for
database/sql
package.
templatex
Note that templatex
is built upon the text/template
package, not the html/template
.
Overview:
- Helpers for template parsing and executing.
- A wrapper of text/template Template, which can load template from a file and provide optional reloading support (useful in development mode).
jsonx
Overview:
- Fetch values of various types from a loosely typed map
map[string]interface{}
.
- Helper to marshal a loosely typed map
map[string]interface{}
from an array of bytes.
License
MIT
Directories
¶
Click to show internal directories.
Click to hide internal directories.