Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfac00c7

Browse files
committed
chore: update preset.icon to use ValidateURL
1 parent6a4d070 commitfac00c7

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

‎provider/workspace_preset.go‎

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package provider
33
import (
44
"context"
55
"fmt"
6-
"net/url"
76
"strings"
87
"time"
98

@@ -106,18 +105,9 @@ func workspacePresetDataSource() *schema.Resource {
106105
Description:"A URL to an icon that will display in the dashboard. View built-in "+
107106
"icons [here](https://github.com/coder/coder/tree/main/site/static/icon). Use a "+
108107
"built-in icon with `\"${data.coder_workspace.me.access_url}/icon/<path>\"`.",
109-
ForceNew:true,
110-
Optional:true,
111-
ValidateFunc:func(valueinterface{},labelstring) ([]string, []error) {
112-
val,ok:=value.(string)
113-
if!ok {
114-
returnnil, []error{fmt.Errorf("expected %q to be a string",label)}
115-
}
116-
if_,err:=url.Parse(val);err!=nil {
117-
returnnil, []error{err}
118-
}
119-
returnnil,nil
120-
},
108+
ForceNew:true,
109+
Optional:true,
110+
ValidateFunc:helpers.ValidateURL,
121111
},
122112
"default": {
123113
Type:schema.TypeBool,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp