Skip to content

Commit

Permalink
remove icon/logo functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nbari committed Jul 22, 2017
1 parent e6bc540 commit b2c4fed
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
2 changes: 1 addition & 1 deletion cmd/immortal/main.go
Expand Up @@ -79,7 +79,7 @@ func main() {
log.Fatal(err)
}

log.Printf("%c %d", immortal.Logo(), os.Getpid())
log.Printf("%c %d", 0x2B55, os.Getpid())

// listen on socket
if err := daemon.Listen(); err != nil {
Expand Down
19 changes: 0 additions & 19 deletions funcs.go
Expand Up @@ -9,28 +9,9 @@ import (
"net"
"net/http"
"os"
"strconv"
"time"
)

const (
logo = "2B55"
)

// Logo print ⭕
func Logo() rune {
return Icon(logo)
}

// Icon Unicode Hex to string
func Icon(h string) rune {
i, e := strconv.ParseInt(h, 16, 32)
if e != nil {
return 0
}
return rune(i)
}

// GetJSON unix socket web client
func GetJSON(spath, path string, target interface{}) error {
// http socket client
Expand Down
21 changes: 0 additions & 21 deletions funcs_test.go
Expand Up @@ -7,27 +7,6 @@ import (
"time"
)

func TestLogo(t *testing.T) {
logo := Logo()
if logo != 11093 {
t.Errorf("Expecting: 11093 got: %v", logo)
}
}

func TestIconOk(t *testing.T) {
i := Icon("1F621")
if i != 128545 {
t.Errorf("Expecting: 128545 got: %v", i)
}
}

func TestIconErr(t *testing.T) {
i := Icon(" ")
if i != 0 {
t.Errorf("Expecting: 0 got: %v", i)
}
}

func TestAbsSince(t *testing.T) {
start := time.Unix(0, 0)
diff := AbsSince(start)
Expand Down

0 comments on commit b2c4fed

Please sign in to comment.