mirror of
https://github.com/Lore09/Tesi-Magistrale.git
synced 2025-12-19 12:24:31 +00:00
setup bench
This commit is contained in:
24
project/tasks/double.go
Normal file
24
project/tasks/double.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user