Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
7c5760eb
Commit
7c5760eb
authored
Sep 08, 2016
by
alexstocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add HostAddress2 & HostPort in utility.go
parent
1b4ba19b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
utils.go
utils.go
+16
-0
No files found.
utils.go
View file @
7c5760eb
...
...
@@ -15,11 +15,27 @@ import (
"time"
)
/////////////////////////////////////////
// network utility
/////////////////////////////////////////
// HostAddress composes a ip:port style address. Its opposite function is net.SplitHostPort.
func
HostAddress
(
host
string
,
port
int
)
string
{
return
net
.
JoinHostPort
(
host
,
strconv
.
Itoa
(
port
))
}
func
HostAddress2
(
host
string
,
port
string
)
string
{
return
net
.
JoinHostPort
(
host
,
port
)
}
func
HostPort
(
addr
string
)
(
string
,
string
,
error
)
{
return
net
.
SplitHostPort
(
addr
)
}
/////////////////////////////////////////
// count watch
/////////////////////////////////////////
type
CountWatch
struct
{
start
time
.
Time
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment