Compare commits

...

21 Commits
v2.0.1 ... main

Author SHA1 Message Date
renovate[bot]
9047fa86a4 chore(deps): update dependency golangci/golangci-lint to v1.59.1 2024-06-10 04:25:49 +00:00
renovate[bot]
441a10a33d chore(deps): update dependency golangci/golangci-lint to v1.59.0 2024-05-27 03:29:11 +00:00
renovate[bot]
3c053eef7d
fix(deps): update module github.com/rs/zerolog to v1.33.0 (#95)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-24 09:25:36 +02:00
renovate[bot]
cf3d105310 chore(deps): update dependency golangci/golangci-lint to v1.58.2 2024-05-20 07:10:04 +00:00
renovate[bot]
70f0d4e5b3 chore(deps): update dependency golangci/golangci-lint to v1.58.1 2024-05-13 04:56:02 +00:00
9ff6cd2e6a
ci: fix golangci-lint deprecations 2024-05-12 11:08:22 +02:00
renovate[bot]
d36d95846e chore(deps): update dependency golangci/golangci-lint to v1.58.0 2024-05-06 07:57:19 +00:00
renovate[bot]
5c8b9d9cd5
fix(deps): update module github.com/urfave/cli/v2 to v2.27.2 (#91)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-29 10:27:12 +02:00
renovate[bot]
77d3c11da1 chore(deps): update dependency golangci/golangci-lint to v1.57.2 2024-04-01 03:29:42 +00:00
renovate[bot]
df1cb658f3 chore(deps): update dependency golangci/golangci-lint to v1.57.1 2024-03-25 03:25:18 +00:00
renovate[bot]
659ddcee44 chore(deps): update dependency golangci/golangci-lint to v1.56.2 2024-02-19 03:52:57 +00:00
7d4e9651f5
[skip ci] revert renovate automerge config 2024-02-15 12:19:23 +01:00
renovate[bot]
c6b5c9d03d
chore(deps): update dependency golangci/golangci-lint to v1.56.1 (#87)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-02-12 09:09:30 +01:00
renovate[bot]
656f744c52
chore(deps): update docker.io/library/golang docker tag to v1.22 (#86)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
2024-02-07 22:33:53 +01:00
b01ea54ae9
run ci on renovate auto branches 2024-02-07 09:10:05 +01:00
6c04899a49
ci: enable ci run on renovate branches 2024-02-05 08:58:24 +01:00
renovate[bot]
edbced6e5b
fix(deps): update module github.com/rs/zerolog to v1.32.0 (#85)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-05 08:45:18 +01:00
renovate[bot]
8f8506617a chore(deps): update dependency mvdan/gofumpt to v0.6.0 2024-01-30 08:40:32 +00:00
renovate[bot]
7cbec15ac2
fix(deps): update module github.com/urfave/cli/v2 to v2.27.1 (#83)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-01 16:21:59 +01:00
5f80b2a7f3
use list style synatx and cleanup (#82) 2023-12-23 23:43:43 +01:00
8c4de70ec4
ci: add missing test group 2023-12-15 22:34:42 +01:00
18 changed files with 41 additions and 44 deletions

View File

@ -23,7 +23,6 @@ linters:
- errchkjson - errchkjson
- errname - errname
- errorlint - errorlint
- execinquery
- exhaustive - exhaustive
- exportloopref - exportloopref
- forcetypeassert - forcetypeassert
@ -37,12 +36,12 @@ linters:
- gocyclo - gocyclo
- godot - godot
- godox - godox
- goerr113 - err113
- gofmt - gofmt
- gofumpt - gofumpt
- goheader - goheader
- goimports - goimports
- gomnd - mnd
- gomoddirectives - gomoddirectives
- gomodguard - gomodguard
- goprintffuncname - goprintffuncname

View File

@ -6,26 +6,25 @@ when:
- ${CI_REPO_DEFAULT_BRANCH} - ${CI_REPO_DEFAULT_BRANCH}
steps: steps:
build: - name: build
image: docker.io/techknowlogick/xgo:go-1.21.x image: docker.io/techknowlogick/xgo:go-1.22.x
commands: commands:
- ln -s $(pwd) /source - ln -s $(pwd) /source
- make release - make release
executable: - name: executable
image: quay.io/thegeeklab/alpine-tools image: quay.io/thegeeklab/alpine-tools
commands: commands:
- $(find dist/ -executable -type f -iname ${CI_REPO_NAME}-linux-amd64) --help - $(find dist/ -executable -type f -iname ${CI_REPO_NAME}-linux-amd64) --help
changelog: - name: changelog
image: quay.io/thegeeklab/git-sv image: quay.io/thegeeklab/git-sv
commands: commands:
- git fetch --depth=2147483647
- git sv current-version - git sv current-version
- git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md - git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md
- cat CHANGELOG.md - cat CHANGELOG.md
publish-github: - name: publish-github
image: docker.io/plugins/github-release image: docker.io/plugins/github-release
settings: settings:
api_key: api_key:
@ -36,7 +35,7 @@ steps:
overwrite: true overwrite: true
title: ${CI_COMMIT_TAG} title: ${CI_COMMIT_TAG}
when: when:
- event: [tag] - event: [tag]
depends_on: depends_on:
- test - test

View File

@ -6,18 +6,17 @@ when:
- ${CI_REPO_DEFAULT_BRANCH} - ${CI_REPO_DEFAULT_BRANCH}
steps: steps:
markdownlint: - name: markdownlint
image: quay.io/thegeeklab/markdownlint-cli image: quay.io/thegeeklab/markdownlint-cli
commands: commands:
- markdownlint 'README.md' 'CONTRIBUTING.md' - markdownlint 'README.md' 'CONTRIBUTING.md'
spellcheck: - name: spellcheck
image: quay.io/thegeeklab/alpine-tools image: quay.io/thegeeklab/alpine-tools
commands: commands:
- spellchecker --files 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls - spellchecker --files 'README.md' 'CONTRIBUTING.md' -d .dictionary -p spell indefinite-article syntax-urls
environment: environment:
FORCE_COLOR: "true" FORCE_COLOR: "true"
NPM_CONFIG_LOGLEVEL: "error"
depends_on: depends_on:
- build-package - build-package

View File

@ -8,7 +8,7 @@ when:
runs_on: [success, failure] runs_on: [success, failure]
steps: steps:
matrix: - name: matrix
image: quay.io/thegeeklab/wp-matrix image: quay.io/thegeeklab/wp-matrix
settings: settings:
homeserver: homeserver:

View File

@ -6,12 +6,12 @@ when:
- ${CI_REPO_DEFAULT_BRANCH} - ${CI_REPO_DEFAULT_BRANCH}
steps: steps:
lint: - name: lint
image: docker.io/library/golang:1.21 image: docker.io/library/golang:1.22
commands: commands:
- make lint - make lint
test: - name: test
image: docker.io/library/golang:1.21 image: docker.io/library/golang:1.22
commands: commands:
- make test - make test

View File

@ -1,7 +1,7 @@
# renovate: datasource=github-releases depName=mvdan/gofumpt # renovate: datasource=github-releases depName=mvdan/gofumpt
GOFUMPT_PACKAGE_VERSION := v0.5.0 GOFUMPT_PACKAGE_VERSION := v0.6.0
# renovate: datasource=github-releases depName=golangci/golangci-lint # renovate: datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_PACKAGE_VERSION := v1.55.2 GOLANGCI_LINT_PACKAGE_VERSION := v1.59.1
EXECUTABLE := url-parser EXECUTABLE := url-parser
@ -20,7 +20,7 @@ XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GOTESTSUM_PACKAGE ?= gotest.tools/gotestsum@latest GOTESTSUM_PACKAGE ?= gotest.tools/gotestsum@latest
GENERATE ?= GENERATE ?=
XGO_VERSION := go-1.21.x XGO_VERSION := go-1.22.x
XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64 XGO_TARGETS ?= linux/amd64,linux/arm-6,linux/arm-7,linux/arm64
TARGETOS ?= linux TARGETOS ?= linux

View File

@ -99,7 +99,7 @@ func main() {
Action: command.Fragment(cfg), Action: command.Fragment(cfg),
}, },
}, },
Before: func(ctx *cli.Context) error { Before: func(_ *cli.Context) error {
if cfg.URL == "" { if cfg.URL == "" {
stat, _ := os.Stdin.Stat() stat, _ := os.Stdin.Stat()
if (stat.Mode() & os.ModeCharDevice) == 0 { if (stat.Mode() & os.ModeCharDevice) == 0 {

View File

@ -9,7 +9,7 @@ import (
// Fragment prints out the fragment part from the url. // Fragment prints out the fragment part from the url.
func Fragment(cfg *config.Config) cli.ActionFunc { func Fragment(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
if len(parts.Scheme) > 0 { if len(parts.Scheme) > 0 {

View File

@ -9,7 +9,7 @@ import (
// Host prints out the host part from the url. // Host prints out the host part from the url.
func Host(cfg *config.Config) cli.ActionFunc { func Host(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
if len(parts.Scheme) > 0 { if len(parts.Scheme) > 0 {

View File

@ -9,7 +9,7 @@ import (
// Password prints out the password part from url. // Password prints out the password part from url.
func Password(cfg *config.Config) cli.ActionFunc { func Password(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
if parts.User != nil { if parts.User != nil {

View File

@ -23,7 +23,7 @@ func PathFlags(cfg *config.Config) []cli.Flag {
// Path prints out the path part from url. // Path prints out the path part from url.
func Path(cfg *config.Config) cli.ActionFunc { func Path(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
i := cfg.PathIndex i := cfg.PathIndex

View File

@ -9,7 +9,7 @@ import (
// Port prints out the port from the url. // Port prints out the port from the url.
func Port(cfg *config.Config) cli.ActionFunc { func Port(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
if len(parts.Scheme) > 0 { if len(parts.Scheme) > 0 {

View File

@ -21,7 +21,7 @@ func QueryFlags(cfg *config.Config) []cli.Flag {
// Query prints out the query part from url. // Query prints out the query part from url.
func Query(cfg *config.Config) cli.ActionFunc { func Query(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
f := cfg.QueryField f := cfg.QueryField

View File

@ -9,7 +9,7 @@ import (
// Run default command and print out full url. // Run default command and print out full url.
func Run(cfg *config.Config) cli.ActionFunc { func Run(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
if len(parts.String()) > 0 { if len(parts.String()) > 0 {

View File

@ -9,7 +9,7 @@ import (
// Scheme prints out the scheme part from the url. // Scheme prints out the scheme part from the url.
func Scheme(cfg *config.Config) cli.ActionFunc { func Scheme(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
if len(parts.Scheme) > 0 { if len(parts.Scheme) > 0 {

View File

@ -9,7 +9,7 @@ import (
// User prints out the user part from url. // User prints out the user part from url.
func User(cfg *config.Config) cli.ActionFunc { func User(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error { return func(_ *cli.Context) error {
parts := parseURL(cfg.URL) parts := parseURL(cfg.URL)
if parts.User != nil { if parts.User != nil {

10
go.mod
View File

@ -1,18 +1,18 @@
module github.com/thegeeklab/url-parser module github.com/thegeeklab/url-parser
go 1.21 go 1.22
require ( require (
github.com/rs/zerolog v1.31.0 github.com/rs/zerolog v1.33.0
github.com/urfave/cli/v2 v2.26.0 github.com/urfave/cli/v2 v2.27.2
github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04 github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04
) )
require ( require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-isatty v0.0.19 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
golang.org/x/sys v0.12.0 // indirect golang.org/x/sys v0.12.0 // indirect
) )

16
go.sum
View File

@ -1,6 +1,6 @@
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
@ -9,14 +9,14 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI= github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI=
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk=
github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04 h1:qXafrlZL1WsJW5OokjraLLRURHiw0OzKHD/RNdspp4w= github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04 h1:qXafrlZL1WsJW5OokjraLLRURHiw0OzKHD/RNdspp4w=
github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04/go.mod h1:FiwNQxz6hGoNFBC4nIx+CxZhI3nne5RmIOlT/MXcSD4= github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04/go.mod h1:FiwNQxz6hGoNFBC4nIx+CxZhI3nne5RmIOlT/MXcSD4=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=