Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14789)

Issue 77410043: instance: add HostPort type

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by rog
Modified:
10 years, 1 month ago
Reviewers:
gz, mp+211525
Visibility:
Public.

Description

instance: add HostPort type We want this to return it from the API, amongst other places. https://code.launchpad.net/~rogpeppe/juju-core/522-instance-hostport/+merge/211525 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : instance: add HostPort type #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -0 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M instance/address.go View 2 chunks +26 lines, -0 lines 3 comments Download
M instance/address_test.go View 2 chunks +38 lines, -0 lines 1 comment Download

Messages

Total messages: 4
rog
Please take a look.
10 years, 1 month ago (2014-03-18 13:33:36 UTC) #1
gz
LGTM. https://codereview.appspot.com/77410043/diff/20001/instance/address.go File instance/address.go (right): https://codereview.appspot.com/77410043/diff/20001/instance/address.go#newcode55 instance/address.go:55: hps[i] = HostPort{ Oh, interesting, I've been using ...
10 years, 1 month ago (2014-03-18 14:01:32 UTC) #2
rog
https://codereview.appspot.com/77410043/diff/20001/instance/address.go File instance/address.go (right): https://codereview.appspot.com/77410043/diff/20001/instance/address.go#newcode66 instance/address.go:66: return net.JoinHostPort(hp.Value, strconv.FormatInt(int64(hp.Port), 10)) On 2014/03/18 14:01:32, gz wrote: ...
10 years, 1 month ago (2014-03-18 15:11:02 UTC) #3
rog
10 years, 1 month ago (2014-03-18 15:11:49 UTC) #4
On 2014/03/18 15:11:02, rog wrote:
> https://codereview.appspot.com/77410043/diff/20001/instance/address.go
> File instance/address.go (right):
> 
>
https://codereview.appspot.com/77410043/diff/20001/instance/address.go#newcode66
> instance/address.go:66: return net.JoinHostPort(hp.Value,
> strconv.FormatInt(int64(hp.Port), 10))
> On 2014/03/18 14:01:32, gz wrote:
> > I giggle at the dance to turn an int into a string.
> 
> fmt.Sprint(hp.Port) would have been shorter, but I didn't really want to
depend
> on fmt here.

ha, colour me stupid. strconv.Itoa is considerably better here.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b