qual: use url.JoinPath()
for constructing Kamite cmd endpoint URLs
This commit is contained in:
parent
d27039fdb7
commit
27e12057bc
|
@ -25,6 +25,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"github.com/gotk3/gotk3/gdk"
|
"github.com/gotk3/gotk3/gdk"
|
||||||
)
|
)
|
||||||
|
@ -166,6 +167,6 @@ func kamiteSendOCRImageCommand(port int, imgBytes []byte, w, h int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func kamiteMakeEndpointURL(port int, suffix string) string {
|
func kamiteMakeEndpointURL(port int, suffix string) string {
|
||||||
// TODO(fau): Go 1.19+ url.JoinPath()
|
path, _ := url.JoinPath(fmt.Sprintf(kamiteCMDEndpointBaseTpl, port), suffix)
|
||||||
return fmt.Sprintf(kamiteCMDEndpointBaseTpl, port) + suffix
|
return path
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue