Compare commits

...

17 Commits
v2.0.1 ... main

Author SHA1 Message Date
renovate[bot] 70f0d4e5b3 chore(deps): update dependency golangci/golangci-lint to v1.58.1 2024-05-13 04:56:02 +00:00
Robert Kaussow 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
Robert Kaussow 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
Robert Kaussow b01ea54ae9
run ci on renovate auto branches 2024-02-07 09:10:05 +01:00
Robert Kaussow 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
Robert Kaussow 5f80b2a7f3
use list style synatx and cleanup (#82) 2023-12-23 23:43:43 +01:00
Robert Kaussow 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
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forcetypeassert
@ -37,12 +36,12 @@ linters:
- gocyclo
- godot
- godox
- goerr113
- err113
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- mnd
- gomoddirectives
- gomodguard
- goprintffuncname

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
# 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
GOLANGCI_LINT_PACKAGE_VERSION := v1.55.2
GOLANGCI_LINT_PACKAGE_VERSION := v1.58.1
EXECUTABLE := url-parser
@ -20,7 +20,7 @@ XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GOTESTSUM_PACKAGE ?= gotest.tools/gotestsum@latest
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
TARGETOS ?= linux

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ import (
// Password prints out the password part from url.
func Password(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error {
return func(_ *cli.Context) error {
parts := parseURL(cfg.URL)
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.
func Path(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error {
return func(_ *cli.Context) error {
parts := parseURL(cfg.URL)
i := cfg.PathIndex

View File

@ -9,7 +9,7 @@ import (
// Port prints out the port from the url.
func Port(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error {
return func(_ *cli.Context) error {
parts := parseURL(cfg.URL)
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.
func Query(cfg *config.Config) cli.ActionFunc {
return func(ctx *cli.Context) error {
return func(_ *cli.Context) error {
parts := parseURL(cfg.URL)
f := cfg.QueryField

View File

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

View File

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

View File

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

10
go.mod
View File

@ -1,18 +1,18 @@
module github.com/thegeeklab/url-parser
go 1.21
go 1.22
require (
github.com/rs/zerolog v1.31.0
github.com/urfave/cli/v2 v2.26.0
github.com/rs/zerolog v1.32.0
github.com/urfave/cli/v2 v2.27.2
github.com/zenizh/go-capturer v0.0.0-20211219060012-52ea6c8fed04
)
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-isatty v0.0.19 // 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
)

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/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
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/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
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/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
github.com/rs/zerolog v1.32.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/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI=
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI=
github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM=
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw=
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/go.mod h1:FiwNQxz6hGoNFBC4nIx+CxZhI3nne5RmIOlT/MXcSD4=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=