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
var camelre = regexp.MustCompile(`_([a-z])`) | |
// ToUpperCamelCase is an NameFunc that converts strings from snake case to upper camel case. | |
func ToUpperCamelCase(s string) string { | |
return strings.ToUpper(string(s[0])) + camelre.ReplaceAllStringFunc(s[1:len(s)], func(s string) string { | |
return strings.ToUpper(s[1:len(s)]) | |
}) | |
} |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
t1, _ := time.Parse("2006-01-01", "2010-06-05") | |
fmt.Println(t1) |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"reflect" | |
) | |
func main() { | |
funcs := map[string]interface{}{"foo": foo, "bar": bar} |
NewerOlder