Created
July 21, 2018 09:49
-
-
Save l4u/110027262d184097899c5581ab7e63c3 to your computer and use it in GitHub Desktop.
Golang JSON camel case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext/string/inflections' | |
ARGF.each do |line| | |
name = line.split(' ').first | |
puts "#{line.strip} `json:\"#{name.camelize(:lower)}\"`" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment