mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vdoc: fix a panic on v doc -s modname
with an empty module
This commit is contained in:
parent
37927235cd
commit
8a6beac692
@ -127,9 +127,15 @@ fn open_url(url string) {
|
||||
}
|
||||
|
||||
fn (mut cfg DocConfig) serve_html() {
|
||||
server_url := 'http://localhost:' + cfg.server_port.str()
|
||||
docs := cfg.render()
|
||||
dkeys := docs.keys()
|
||||
if dkeys.len < 1 {
|
||||
eprintln('no documentation created, the module has no `pub` functions')
|
||||
exit(1)
|
||||
}
|
||||
def_name := docs.keys()[0]
|
||||
//
|
||||
server_url := 'http://localhost:' + cfg.server_port.str()
|
||||
server := net.listen(cfg.server_port) or {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user