gopaper/main.go

34 lines
485 B
Go
Raw Normal View History

2024-10-26 23:48:17 +00:00
package main
import (
"fmt"
2024-10-29 15:18:21 +00:00
// "log"
2024-10-26 23:48:17 +00:00
"os"
2024-10-28 23:29:20 +00:00
"sync"
2024-10-26 23:48:17 +00:00
)
2024-10-28 23:29:20 +00:00
var config Config
2024-10-26 23:48:17 +00:00
func main() {
2024-10-27 16:21:28 +00:00
config.load()
fmt.Printf("%+v\n", config)
2024-10-26 23:48:17 +00:00
2024-10-29 15:18:21 +00:00
//TODO: make this logic interface more neatly with the slideshow channel
var dir string
args := os.Args[1:]
if len(args) > 0 {
dir = args[0]
} else {
dir = ""
2024-10-26 23:48:17 +00:00
}
2024-10-28 23:29:20 +00:00
var waitGroup sync.WaitGroup
waitGroup.Add(1)
2024-10-29 15:18:21 +00:00
slideshowDir := make(chan string)
go server(slideshowDir)
go slideshow(slideshowDir)
slideshowDir <- dir
2024-10-28 23:29:20 +00:00
waitGroup.Wait()
2024-10-26 23:48:17 +00:00
}