mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
finetuning slice argument unmarshalling
This commit is contained in:
parent
42d37654e2
commit
d0e25dffbb
2
go.go
2
go.go
@ -244,8 +244,6 @@ func renderServiceProxies(services map[string]*Service, fullPackageName string,
|
||||
|
||||
args = append(args, arg.Value.emptyLiteral(aliases))
|
||||
switch arg.Value.GoScalarType {
|
||||
case "int64":
|
||||
callArgs = append(callArgs, fmt.Sprint(arg.Value.GoScalarType+"(args[", skipArgI, "].(float64))"))
|
||||
default:
|
||||
// assert
|
||||
callArgs = append(callArgs, fmt.Sprint("args[", skipArgI, "].("+arg.Value.goType(aliases, fullPackageName)+")"))
|
||||
|
||||
@ -35,7 +35,7 @@ func ErrorMethodNotAllowed(w http.ResponseWriter) {
|
||||
w.Write([]byte("you gotta POST"))
|
||||
}
|
||||
|
||||
func LoadArgs(args []interface{}, callStats *CallStats, r *http.Request) error {
|
||||
func LoadArgs(args interface{}, callStats *CallStats, r *http.Request) error {
|
||||
start := time.Now()
|
||||
decoder := json.NewDecoder(r.Body)
|
||||
err := decoder.Decode(&args)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user