Comments (5)
go vet
will complain if the tag is not key:"value"
:
https://github.com/golang/tools/blob/master/cmd/vet/structtag.go#L70
from go-restructure.
You should probably use the tag "restructure" instead, since that's the name of your library.
from go-restructure.
I think re
(after Python's regexp package) is nice and succinct tag name.
type Example struct {
MyField string `re:"[^@]+"`
}
from go-restructure.
Would really love this feature. Perhaps use restructure
OR re
? If it has to be one, propriety suggests it should be restructure
, because explicit is better than...
The only problem with using 'normal' tags is that it imposes a backslash burden on quotes in the regex, but the advantages, IMO, outweigh that. The convenience of being able to Regex-out something and immediately serialise to JSON with tagged params, for example, is an obvious use-case.
from go-restructure.
This was resolved in #12
from go-restructure.
Related Issues (18)
- license? HOT 1
- JS port HOT 3
- Example with email address HOT 2
- Capture groups in tags interfere with capture groups from your library HOT 4
- ragel backend with code generation? HOT 1
- Optional terminals
- Repeated sub-structs
- Document optional substructs HOT 1
- Expose begin and end position of submatches HOT 1
- Post some benchmarks
- Add example of applying restructuring as part of a JSON unmarshal. HOT 1
- Add examples of using `Region` HOT 1
- Add examples of using `Pos`
- Add Regexp.FindAll HOT 1
- Disjunctions
- Add int parsing ? HOT 1
- Module spelling error in go get HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-restructure.