Skip to content

Instantly share code, notes, and snippets.

@ernestl

ernestl/go.mod Secret

Last active August 31, 2023 16:59
Show Gist options
  • Save ernestl/80d8f1df1be8d9a011ca368881ffab44 to your computer and use it in GitHub Desktop.
Save ernestl/80d8f1df1be8d9a011ca368881ffab44 to your computer and use it in GitHub Desktop.
Snapd timer invoked oneshot service
module github.com/ernestl/hello-world
go 1.19
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Hello world running starting...")
for {
fmt.Println("Hello World!")
time.Sleep(2 * time.Second)
}
}
name: hello-world-service
base: core20
version: '0.1'
summary: Hello world service
description: |
Prints "hello world" in the journal every 2 seconds
grade: stable
confinement: strict
apps:
print-hello:
command: bin/hello-world
daemon: simple
parts:
hello-world:
plugin: go
source-type: local
source: .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment