File tree 3 files changed +22
-1
lines changed
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change
1
+ # This configuration file was automatically generated by Gitpod.
2
+ # Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
3
+ # and commit this file to your remote git repository to share the goodness with others.
4
+
5
+ tasks :
6
+ - init : go get && go build ./... && go test ./...
7
+ command : go run
8
+
9
+
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ func init() {
38
38
func main () {
39
39
if open {
40
40
go func () {
41
- if err := Open (fmt .Sprintf ("http://127.0.0.1 :%d" , port )); err != nil {
41
+ if err := Open (fmt .Sprintf ("http://%s :%d" , IP () , port )); err != nil {
42
42
log .Printf ("can not open default browser %s" , err )
43
43
}
44
44
}()
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "net"
5
+ )
6
+
7
+ func IP () string {
8
+ conn , _ := net .Dial ("udp" , "8.8.8.8:80" )
9
+
10
+ defer conn .Close ()
11
+ return conn .LocalAddr ().(* net.UDPAddr ).IP .String ()
12
+ }
You can’t perform that action at this time.
0 commit comments