Skip to content

Commit

Permalink
fix: Update
Browse files Browse the repository at this point in the history
  • Loading branch information
sirateek committed Apr 5, 2024
1 parent 1ec151a commit eaec0a9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
)

type TaskAttribute struct {
SleepTime *time.Duration `json:"sleepTime,omitempty"`
MemoryAllocationSize *int `json:"memoryAllocationSize,omitempty"`
SleepTime *int `json:"sleepTime,omitempty"`
MemoryAllocationSize *int `json:"memoryAllocationSize,omitempty"`
}

func main() {
Expand All @@ -24,9 +24,9 @@ func main() {
return err
}

if unmarshalledData.SleepTime == nil {
sleepTime := 15 * time.Second
unmarshalledData.SleepTime = &sleepTime
sleepTime := 15 * time.Second
if unmarshalledData.SleepTime != nil {
sleepTime = time.Duration(*unmarshalledData.SleepTime) * time.Second
}

if unmarshalledData.MemoryAllocationSize == nil {
Expand All @@ -39,7 +39,7 @@ func main() {
fakeAllocation[i] = 0x99
}

time.Sleep(*unmarshalledData.SleepTime)
time.Sleep(sleepTime)
fmt.Println(unmarshalledData)

ctx.Success()
Expand Down

0 comments on commit eaec0a9

Please sign in to comment.