Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion gen/gotpl/extra.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@ func (err ErrUnknownCommandOrEvent) Error() string {
{% func ExtraMethodTypeTemplate(domains []*pdl.Domain) %}
// Domain returns the Chrome DevTools Protocol domain of the event or command.
func (t MethodType) Domain() string {
return string(t[:strings.IndexByte(string(t), '.')])
if i := strings.IndexByte(string(t), '.'); i != -1 {
return string(t[:i])
}
return ""
}

// MethodType values.
Expand Down