mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 11:27:50 +00:00
Unexport URI.SetScheme
This commit is contained in:
parent
ac83bf4422
commit
7807b92b13
3 changed files with 5 additions and 5 deletions
4
uri.go
4
uri.go
|
|
@ -82,8 +82,8 @@ func NewURIFromAddress(address string) (*URI, error) {
|
|||
return parseAddress(address)
|
||||
}
|
||||
|
||||
// SetScheme sets the scheme of this URI.
|
||||
func (u *URI) SetScheme(scheme string) error {
|
||||
// setScheme sets the scheme of this URI.
|
||||
func (u *URI) setScheme(scheme string) error {
|
||||
m := schemeRegexp.FindStringSubmatch(scheme)
|
||||
if m == nil {
|
||||
return errors.New("invalid scheme")
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ func TestURIPath(t *testing.T) {
|
|||
func TestSetScheme(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
target := "fun"
|
||||
err := uri.SetScheme(target)
|
||||
err := uri.setScheme(target)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ func TestSetPort(t *testing.T) {
|
|||
|
||||
func TestSetInvalidScheme(t *testing.T) {
|
||||
uri := defaultURI()
|
||||
err := uri.SetScheme("?invalid")
|
||||
err := uri.setScheme("?invalid")
|
||||
if err == nil {
|
||||
t.Fatalf("Should have failed")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ func NewTestCluster(n int) *cluster {
|
|||
// NewTestURI is a test URI creator that intentionally swallows errors.
|
||||
func NewTestURI(scheme, host string, port uint16) URI {
|
||||
uri := defaultURI()
|
||||
uri.SetScheme(scheme)
|
||||
uri.setScheme(scheme)
|
||||
uri.setHost(host)
|
||||
uri.SetPort(port)
|
||||
return *uri
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue