Skip to content

Commit e08e718

Browse files
authored
Initial implementation (#2)
1 parent cbb03b8 commit e08e718

File tree

5 files changed

+40
-47
lines changed

5 files changed

+40
-47
lines changed

README.md

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
# 🐭 go-template ![Go](https://github.com/wuhan005/Elaina/workflows/Go/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/wuhan005/go-template)](https://goreportcard.com/report/github.com/wuhan005/go-template)
1+
# 💓 mebeats ![Go](https://github.com/wuhan005/mebeats/workflows/Go/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/wuhan005/mebeats)](https://goreportcard.com/report/github.com/wuhan005/mebeats)
22

3-
My Go Project Template
3+
Your Soul, Your Beats!
44

55
## Start
66

7-
* Update `README.md`.
8-
* Choose a cool emoji.
9-
* Rename the project.
10-
* Update the Go badge, Go report card badge.
11-
* Update the project description.
12-
* Choose a friendly open source license.
13-
* Rename the package in `go.mod`.
14-
* Inspire the world!
7+
TBD
158

169
## License
10+
11+
MIT

Taskfile.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tasks:
1111
desc: Build binary & Run
1212
deps: [ build ]
1313
cmds:
14-
- ./.bin/go-template
14+
- ./.bin/mebeats
1515
sources:
1616
- ./**/*.go
1717

@@ -20,4 +20,4 @@ tasks:
2020
cmds:
2121
- go build -v
2222
-trimpath
23-
-o ./.bin/go-template
23+
-o ./.bin/mebeats

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/wuhan005/go-template
1+
module github.com/wuhan005/mebeats
22

33
go 1.16
44

main.go

-34
This file was deleted.

mebeats.go

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2021 E99p1ant. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import (
8+
"flag"
9+
"os"
10+
"os/signal"
11+
"syscall"
12+
13+
log "unknwon.dev/clog/v2"
14+
)
15+
16+
func main() {
17+
defer log.Stop()
18+
err := log.NewConsole()
19+
if err != nil {
20+
panic(err)
21+
}
22+
23+
deviceName := flag.String("device-name", "", "Mi Band device name.")
24+
_ = flag.String("auth-key", "", "Mi Band auth key.")
25+
flag.Parse()
26+
27+
log.Trace("Try to connect %q...", *deviceName)
28+
29+
sig := make(chan os.Signal, 1)
30+
signal.Notify(sig, os.Interrupt, syscall.SIGTERM)
31+
<-sig
32+
}

0 commit comments

Comments
 (0)