mirror of
https://github.com/Lore09/Tesi-Magistrale.git
synced 2025-12-19 04:14:35 +00:00
24 lines
322 B
Go
24 lines
322 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type Request struct {
|
|
Data int
|
|
Name string
|
|
}
|
|
|
|
func exec_task(arg string) string{
|
|
|
|
req := Request{}
|
|
|
|
json.Unmarshal([]byte(arg), &req)
|
|
|
|
// double the data field
|
|
req.Data = req.Data * 2
|
|
|
|
// return the json string
|
|
json, _ := json.Marshal(req)
|
|
return string(json)
|
|
} |