Yet, another utility package of Go.
go get github.com/KEINOS/go-utiles
For available functions and example usages, see:
- Doc ./util/README.md
- or the automated reference at
pkg.go.dev
- MIT License. Copyright (c) KEINOS and The Contributors.
Yet another utilities of Go.
License: MIT License
Yet, another utility package of Go.
go get github.com/KEINOS/go-utiles
For available functions and example usages, see:
pkg.go.dev
The go-version.yml
passes the test on unit test failure.
docker-compose up
won't return an error on failure, since the container itself successfully booted.
go-utiles/.github/workflows/go-versions.yml
Lines 73 to 74 in f539211
--abort-on-container-exit
option.
- docker-compose --file ./.github/docker-compose.yml up v1_14
+ docker-compose --file ./.github/docker-compose.yml up --abort-on-container-exit v1_14
run
command. (recommended)
- docker-compose --file ./.github/docker-compose.yml up v1_14
+ docker-compose --file ./.github/docker-compose.yml run v1_14
If case input was "v1.2.3-4-
" then the util.ParseVersion()
returns:
1.2.3-4
1.2.3-4-
In some cases the git tag's commit ID is empty.
The GetNameBin
function is mainly used to print the version.
However, on Windows, unlike on macOS and Linux, it has the extension ".exe". Therefore, it will be necessary to incorporate tests only for the Windows environment.
To accelerate testing while using the cached image, COPY the go.mod
and go.sum
and download them.
If so, it will only download/update the diff while running the container.
This package should be written in English for my practice.
Lines 7 to 8 in 4bd4670
func TestParseVersion(t *testing.T) {
for _, test := range []struct {
expect map[string]string
input string
}{
{
map[string]string{"major": "1", "minor": "2", "patch": "3", "prerelease": "", "build": "12345"},
"v.1.2.3+12345",
},
} {
actual, err := util.ParseVersion(test.input)
require.NoError(t, err)
require.Equal(t, test.expect, actual, "input: %s", test.input)
}
}
--- FAIL: TestParseVersion (0.00s)
/workspaces/go-utiles/util/ParseVersion_test.go:62:
Error Trace: ParseVersion_test.go:62
Error: Received unexpected error:
invalid version string
Test: TestParseVersion
FAIL
FAIL github.com/KEINOS/go-utiles/util 0.005s
FAIL
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.