The only difference is that uri.PathEscape will also escape ( and ) which while not required is acceptable according to rfc2396. Data uri tend to be used in places where escaping ()s can be useful (css, etc) and as such, golang's implementation makes more sense.