diff options
Diffstat (limited to 'src/c_go2work.go')
-rw-r--r-- | src/c_go2work.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/c_go2work.go b/src/c_go2work.go index e11dab4..5a42160 100644 --- a/src/c_go2work.go +++ b/src/c_go2work.go @@ -52,7 +52,6 @@ import ( "os" "strconv" "strings" - "time" ) func main() { @@ -105,46 +104,3 @@ func main() { print_time_left(curr_t, dest_t) main_loop(dest_t, options) } - -func main_loop(dest_t [3]byte, options Options) { - var curr_t [3]byte - ticker := time.NewTicker(INTERVAL * time.Millisecond) - quit := make(chan struct{}) - for { - select { - case <- ticker.C: - curr_t = get_time() - print_time_left(curr_t, dest_t) - if curr_t[HOURS] == dest_t[HOURS] && - curr_t[MINS] == dest_t[MINS] && - curr_t[SECS] == dest_t[SECS] { - file_id := choose_file(options) - var args []string - if file_id >= 0 { - args = append( - options.Player_options, - options.Files[file_id], - ) - } else { - args = append( - options.Player_options, - DEF_FILES()[0], - ) - } - has_rang := false - for { - exec_player( - options.Fortune, - has_rang, - options.Media_player, - args..., - ) - has_rang = true - } - } - case <- quit: - ticker.Stop() - return - } - } -} |