34 lines
485 B
Go
34 lines
485 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
// "log"
|
|
"os"
|
|
"sync"
|
|
)
|
|
|
|
var config Config
|
|
|
|
func main() {
|
|
|
|
config.load()
|
|
fmt.Printf("%+v\n", config)
|
|
|
|
//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 = ""
|
|
}
|
|
|
|
var waitGroup sync.WaitGroup
|
|
waitGroup.Add(1)
|
|
slideshowDir := make(chan string)
|
|
go server(slideshowDir)
|
|
go slideshow(slideshowDir)
|
|
slideshowDir <- dir
|
|
waitGroup.Wait()
|
|
}
|