From 4da39417e0c33c82dba22d4e2f1a49dc7f20dee6 Mon Sep 17 00:00:00 2001 From: sergei Date: Wed, 7 Jun 2023 11:03:29 +0400 Subject: [PATCH] fix mod --- .gitignore | 1 + README.md | 8 ++++---- examples/gomods/README.md | 2 +- examples/gomods/main.go | 2 +- go.mod | 4 ++-- go.sum | 21 --------------------- stringer.go | 4 ++-- 7 files changed, 11 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 44f0924..03670c4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,5 +27,6 @@ coverage.txt .idea .vscode +vendor enumer diff --git a/README.md b/README.md index ee79eb6..cd62713 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Enumer [![GoDoc](https://godoc.org/github.com/dmarkham/enumer?status.svg)](https://godoc.org/github.com/dmarkham/enumer) [![Go Report Card](https://goreportcard.com/badge/github.com/dmarkham/enumer)](https://goreportcard.com/report/github.com/dmarkham/enumer) [![GitHub Release](https://img.shields.io/github/release/dmarkham/enumer.svg)](https://github.com/dmarkham/enumer/releases)[![Build Status](https://travis-ci.com/dmarkham/enumer.svg?branch=master)](https://travis-ci.com/dmarkham/enumer) +# Enumer [![GoDoc](https://godoc.org/github.com/SergeiSkv/enumer?status.svg)](https://godoc.org/github.com/SergeiSkv/enumer) [![Go Report Card](https://goreportcard.com/badge/github.com/SergeiSkv/enumer)](https://goreportcard.com/report/github.com/SergeiSkv/enumer) [![GitHub Release](https://img.shields.io/github/release/dmarkham/enumer.svg)](https://github.com/SergeiSkv/enumer/releases)[![Build Status](https://travis-ci.com/dmarkham/enumer.svg?branch=master)](https://travis-ci.com/dmarkham/enumer) Enumer is a tool to generate Go code that adds useful methods to Go enums (constants with a specific type). It started as a fork of [Rob Pike’s Stringer tool](https://godoc.org/golang.org/x/tools/cmd/stringer) maintained by [Álvaro López Espinosa](https://github.com/alvaroloes/enumer). -This was again forked here as (https://github.com/dmarkham/enumer) picking up where Álvaro left off. +This was again forked here as (https://github.com/SergeiSkv/enumer) picking up where Álvaro left off. ``` @@ -14,7 +14,7 @@ Usage of ./enumer: Enumer [flags] -type T [directory] Enumer [flags] -type T files... # Must be a single package For more information, see: - http://godoc.org/github.com/dmarkham/enumer + http://godoc.org/github.com/SergeiSkv/enumer Flags: -addprefix string transform each item name by adding a prefix. Default: "" @@ -198,7 +198,7 @@ name := MyTypeValue.String() // name => "my_type_value" For a module-aware repo with `enumer` in the `go.mod` file, generation can be called by adding the following to a `.go` source file: ```golang -//go:generate go run github.com/dmarkham/enumer -type=YOURTYPE +//go:generate go run github.com/SergeiSkv/enumer -type=YOURTYPE ``` There are four boolean flags: `json`, `text`, `yaml` and `sql`. You can use any combination of them (i.e. `enumer -type=Pill -json -text`), diff --git a/examples/gomods/README.md b/examples/gomods/README.md index 8d96aa0..1d8dc05 100644 --- a/examples/gomods/README.md +++ b/examples/gomods/README.md @@ -2,7 +2,7 @@ ## Steps - 1. Go get enumer `go get -u github.com/dmarkham/enumer` + 1. Go get enumer `go get -u github.com/SergeiSkv/enumer` 2. `go generate` This should create `pill_enumer.go` 3. `go run *.go` to see it in action 4. `go mod tidy` to remove the deps for `enumer` once your happy. diff --git a/examples/gomods/main.go b/examples/gomods/main.go index 7d38027..5720d93 100644 --- a/examples/gomods/main.go +++ b/examples/gomods/main.go @@ -2,7 +2,7 @@ package main import "fmt" -//go:generate go run github.com/dmarkham/enumer -type=Pill -json +//go:generate go run github.com/SergeiSkv/enumer -type=Pill -json type Pill int const ( diff --git a/go.mod b/go.mod index 028dbc4..b9ef759 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/dmarkham/enumer +module github.com/SergeiSkv/enumer require ( github.com/pascaldekloe/name v1.0.0 @@ -10,4 +10,4 @@ require ( golang.org/x/sys v0.5.0 // indirect ) -go 1.17 +go 1.20 diff --git a/go.sum b/go.sum index 09ad94b..0ec69a3 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,8 @@ github.com/pascaldekloe/name v1.0.0 h1:n7LKFgHixETzxpRv2R77YgPUFo85QHGZKrdaYm7eY5U= github.com/pascaldekloe/name v1.0.0/go.mod h1:Z//MfYJnH4jVpQ9wkclwu2I2MkHmXTlT9wR5UZScttM= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/stringer.go b/stringer.go index f414659..dae9cf5 100644 --- a/stringer.go +++ b/stringer.go @@ -5,7 +5,7 @@ // Enumer is a tool to generate Go code that adds useful methods to Go enums (constants with a specific type). // It started as a fork of Rob Pike’s Stringer tool // -// Please visit http://github.com/dmarkham/enumer for a comprehensive documentation +// Please visit http://github.com/SergeiSkv/enumer for a comprehensive documentation package main import ( @@ -73,7 +73,7 @@ func Usage() { _, _ = fmt.Fprintf(os.Stderr, "\tEnumer [flags] -type T [directory]\n") _, _ = fmt.Fprintf(os.Stderr, "\tEnumer [flags] -type T files... # Must be a single package\n") _, _ = fmt.Fprintf(os.Stderr, "For more information, see:\n") - _, _ = fmt.Fprintf(os.Stderr, "\thttp://godoc.org/github.com/dmarkham/enumer\n") + _, _ = fmt.Fprintf(os.Stderr, "\thttp://godoc.org/github.com/SergeiSkv/enumer\n") _, _ = fmt.Fprintf(os.Stderr, "Flags:\n") flag.PrintDefaults() }