I disagree with this logic. I also use "net/url" to parse file:// scheme
URLs, which also don't have a valid interpretation of a "host".

On Fri, 21 Feb 2025 at 07:18, robert engels <reng...@ix.netcom.com> wrote:

> I think I disagree. The bnf you are quoting form is from “For example,
> some URI schemes do not allow an <authority> component, and others do not
> use a <query> component.”
>
> The http scheme requires the //.
>
> And since the return struct from URL.parse() has fields like “host”, it
> implies it has semantic understanding, otherwise the only result possible
>
> scheme, andtherest…
>
> with no parsing of other.
>
> The previous email I sent had a reference to the common format of many
> “scheme”s using the authority… but this is not required.
>
>
> > On Feb 21, 2025, at 12:04 AM, 'Dan Kortschak' via golang-nuts <
> golang-nuts@googlegroups.com> wrote:
> >
> > On Thu, 2025-02-20 at 23:38 -0600, robert engels wrote:
> >> Also, see https://datatracker.ietf.org/doc/html/rfc2396#section-3 for
> >> more details on the scheme + authority.
> >
> >
> > The BNF is (including only the parts that are necessary to show
> > validity):
> >
> > absoluteURI   = scheme ":" ( hier_part | opaque_part )
> > hier_part     = ( net_path | abs_path ) [ "?" query ]
> > abs_path      = "/"  path_segments
> > path_segments = segment *( "/" segment )
> > segment       = *pchar *( ";" param )
> > param         = *pchar
> > pchar         = unreserved | escaped |
> >                ":" | "@" | "&" | "=" | "+" | "$" | ","
> >
> > The original URI (I miswrote URL for URI in my last post — the
> > url.Parse documentation notes "technically, a URI reference") was
> > "http:/127.0.0.1/index.html" which can be broken into:
> >
> > scheme   = http
> > abs_path = /127.0.0.1/index.html
> >
> > The url.Parse function doesn't examine semantics, that's the caller's
> > responsibility. The semantics here are clearly wrong, but it's up to
> > the caller to check and ensure that the passed value satisfies the
> > expectations.
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "golang-nuts" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to golang-nuts+unsubscr...@googlegroups.com.
> > To view this discussion visit
> https://groups.google.com/d/msgid/golang-nuts/e5d3b0bf3f9c51c18b4170fc2b15bfae469cf57f.camel%40kortschak.io
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion visit
> https://groups.google.com/d/msgid/golang-nuts/96AA5F8C-CA16-4322-88C4-0B28399203DC%40ix.netcom.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfF9YcxzQTMG0jimCnuTvLgknP7-UzBuVLcZsk%2BRS_DC3g%40mail.gmail.com.

Reply via email to