<html><head></head><body bgcolor="#FFFFFF"><div><br><br><br>Begin forwarded message:<br><br></div><blockquote type="cite"><div><b>From:</b> Dave Cheney <<a href="mailto:dave@cheney.net">dave@cheney.net</a>><br><b>Date:</b> 20 June 2012 19:59:54 AEST<br><b>To:</b> <a href="mailto:juju-dev@lists.ubuntu.com">juju-dev@lists.ubuntu.com</a><br><b>Subject:</b> <b>Machine.InstanceId error condition.</b><br><br></div></blockquote><div><span></span></div><blockquote type="cite"><div><span>Hello,</span><br><span></span><br><span>I'm working on a branch to address the todo surrounding machine.InstanceId retuning an error if no Id was set. Given the frequency of this condition (at least 50% of the code paths expect the instance id to be _not_ set) I am considering this signature. </span><br><span></span><br><span>id, set, err := machine.InstanceId()</span><br><span></span><br><span>Where set is a Boolean, and error is only non nil when something error worthy happened. </span><br><span></span><br><span>In other words, id should not be an empty string unless set is false or err is non nil. </span><br><span></span><br><span>I've already prototyped the more obvious</span><br><span></span><br><span>id, err := ...</span><br><span></span><br><span>version, but found that I was duplicating a lot of logic dissecting the err value for the NoInstanceIdError sentinel. </span><br><span></span><br><span>Thoughts</span><br><span></span><br><span>Cheers</span><br><span></span><br><span>Dave</span></div></blockquote></body></html>