vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.5k stars 2.15k forks source link

net: Corrected `status()` method comment to indicate return of `Status` enum field instead of struct. #21735

Closed carlosaherrera closed 3 days ago

carlosaherrera commented 3 days ago

The status() method comment states it returns a Status struct. This is incorrect. It in fact returns a field of the Status enum. I have updated the comment to reflect this and used wording to be consistent with https://github.com/vlang/v/blob/8466c6c03d77ae623ffc023272aacaa569c942ae/vlib/net/http/status.v#L79 .

carlosaherrera commented 3 days ago

Question. https://modules.vlang.io/net.http.html#Response.status has the same issue. Is the documentation derived from the source code? If so, then it should be safe to say this change of mine will be reflected in the documentation automatically.

carlosaherrera commented 3 days ago

Question. https://modules.vlang.io/net.http.html#Response.status has the same issue. Is the documentation derived from the source code? If so, then it should be safe to say this change of mine will be reflected in the documentation automatically.

I found my answer

vdoc will generate it from docstrings in the source code

src: https://github.com/vlang/v/blob/master/doc/docs.md#writing-documentation