a few notes on common windows breaking mistakes.
Horacio Duran
horacio.duran at canonical.com
Fri Apr 22 16:48:58 UTC 2016
Hello all, this past week I have spent some time fixing Wintows tests for
go 1.6, many errors where caused by http being more strict on what it will
take on a Get and therefore many innocent mistakes often made in tests
where suddenly not so innocent, so just as a friendly reminder.
* Always join paths with filepath.Join,
* if you want to represent a fake absolute path, don't just append "/"
either try to obtain current root/drive letter or make them into a
conditional variable that uses "<drive letter>:" for windows and "/" for
the rest
* don't craft File URLs (file://) by hand, for this there is
utils.MakeFileURL that has a different implementation for windows and linux
paths. many errors where caused by stuff like: "file://" + aRandomPath +
"/tools" which is a combination of this point and the previous one.
Hope this reminder helps.
Cheers
--
Horacio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20160422/51f906cc/attachment.html>
More information about the Juju-dev
mailing list