pub_sub: go: set publisher sleep to 1 second (#891)

The current implementation calls `time.Sleep(1000)` with untyped
literal `1000`, which is interpreted as 1000 nanoseconds, or 1
millisecond.

This commit changes the sleep duration to proper typed constant
`time.Second`, which corresponds to the sleep time of other
language examples.

Signed-off-by: Paško Zdilar <pasko.zdilar@meshmind.io>
This commit is contained in:
paskozdilar 2023-09-09 00:53:08 +02:00 committed by GitHub
parent a9a48ec754
commit f98a406064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -45,6 +45,6 @@ func main() {
fmt.Println("Published data:", order)
time.Sleep(1000)
time.Sleep(time.Second)
}
}

View File

@ -33,6 +33,6 @@ func main() {
fmt.Println("Published data:", order)
time.Sleep(1000)
time.Sleep(time.Second)
}
}