Comments (18)
cc @breerly @anuptalwalkar
from fx.
FWIW, YARPC needs to support -
in keys that populate a map[string]*
.
For example, see some-service
below:
rpc:
outbounds:
some-service:
tchannel:
with: yohoho
from fx.
i'm pro underscore. we also ran into issues with dashes (-
) in service names.
from fx.
YARPC doesn't allow capitals in service names, read: yarpc/yarpc-go#313
from fx.
this isn't about underscores though. this is camelCase versus snake_case? my vote, as a gopher, is snakeCase, since underscore_case is basically a python-ism
from fx.
I've been writing too much snake_case. It looks more natural in a YAML file. I'm fine with camel though. I think it's worth picking one and sticking to it.
Did we already settle on camelCase for metric tags and values?
from fx.
from fx.
I see UberFx engdocs with snake_case 😄
from fx.
Ok, let's do snake_case
then. However, we'll need to make sure that any existing structs we're populating (e.g. from internal libraries) don't have yaml
annotations that force camelCase. Sound good?
from fx.
from fx.
from fx.
I agree. Mixing is annoying. If using snake is going against most go packages, then it's not worth it.
from fx.
We had a long-ish discussion about this in the relevant zap PR. Seems like most companies end up porting the convention of their primary language to their JSON casing; in general, though, large companies do both. By way of data points:
- Twitter's API is snake cased.
- Facebook's API is snake cased.
- AWS is inconsistent.
- Google is mostly camel cased, and their JSON style guide recommends camel.
I don't have a strong opinion, by my slight preference is to make Go packages use Go's case convention. These aren't cross-language APIs.
from fx.
Note that protobuf (out of google) uses underscore for their json tags https://github.com/peter-edge/protoeasy-go/blob/master/protoeasy.pb.go#L84
I know they are using camel case for kubernetes but I just like underscore more.
from fx.
@akshayjshah did you guys resolve it for zap? if so what did you decide? might as well go with that.
from fx.
Yep, we went with camel-casing.
from fx.
from fx.
I think camel casing wins now, closing this.
from fx.
Related Issues (20)
- Documentation should have a copy button for code snippets HOT 1
- fx.OnStart dependency missing, sometimes HOT 3
- Error on invalid lifecycle hooks
- Handling optional fields in fx.Decorate HOT 3
- Multiple implementations HOT 3
- Optional dependency becomes required if there is a provider available HOT 1
- Factory like provider? HOT 3
- Refresh dependency HOT 5
- `fx.Decorate` not working w/ value groups HOT 3
- doc error on [register a handler with the server] HOT 2
- Fx exiting program before panic in OnStart hook gets reported HOT 1
- Add ability to override os.Exit for fxtest HOT 1
- fx.Evaluate: Support dynamic graphs by returning fx.Option from constructors
- https://github.com/benbjohnson/clock is EOL/archived. HOT 1
- fx.Decorate does not add a missing object to the module HOT 3
- When combining fx.As to annotate return type as interface with optional parameters nil value check is not working as expected HOT 1
- Startup order isn't preserved when using modules HOT 2
- Example test failing in master branch when port 8080 is already in use (89f4a90) HOT 3
- fxevent.Logger: Silence until there's an error
- Slog adapter for fx HOT 4
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 fx.