Skip to content

Commit a877c4e

Browse files
committed
(js.Object).Str() -> String()
1 parent 9792975 commit a877c4e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

playground/playground.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func main() {
8787
case '\r':
8888
toInsert = "\n"
8989
start := codeArea.Prop("selectionStart").Int()
90-
code := scope.Get("code").Str()
90+
code := scope.Get("code").String()
9191
i := strings.LastIndex(code[:start], "\n") + 1
9292
for i < start {
9393
c := code[i]
@@ -104,7 +104,7 @@ func main() {
104104

105105
start := codeArea.Prop("selectionStart").Int()
106106
end := codeArea.Prop("selectionEnd").Int()
107-
code := scope.Get("code").Str()
107+
code := scope.Get("code").String()
108108
scope.Apply(func() {
109109
scope.Set("code", code[:start]+toInsert+code[end:])
110110
})
@@ -120,7 +120,7 @@ func main() {
120120
scope.Set("output", output)
121121
pkgsToLoad = nil
122122

123-
file, err := parser.ParseFile(fileSet, "prog.go", []byte(scope.Get("code").Str()), parser.ParseComments)
123+
file, err := parser.ParseFile(fileSet, "prog.go", []byte(scope.Get("code").String()), parser.ParseComments)
124124
if err != nil {
125125
if list, ok := err.(scanner.ErrorList); ok {
126126
for _, entry := range list {
@@ -208,7 +208,7 @@ func main() {
208208
}()
209209

210210
scope.Set("format", func() {
211-
out, err := format.Source([]byte(scope.Get("code").Str()))
211+
out, err := format.Source([]byte(scope.Get("code").String()))
212212
if err != nil {
213213
scope.Set("output", []Line{Line{"type": "err", "content": err.Error()}})
214214
return
@@ -222,7 +222,7 @@ func main() {
222222
req.ResponseType = xhr.ArrayBuffer
223223
go func() {
224224
// TODO: Send as binary?
225-
err := req.Send(scope.Get("code").Str())
225+
err := req.Send(scope.Get("code").String())
226226
if err != nil || req.Status != 200 {
227227
scope.Apply(func() {
228228
scope.Set("output", []Line{Line{"type": "err", "content": `failed to share snippet`}})
@@ -236,7 +236,7 @@ func main() {
236236

237237
location.Hash = "#/" + id
238238

239-
scope.Set("shareUrl", location.Str())
239+
scope.Set("shareUrl", location.String())
240240
scope.Set("showShareUrl", true)
241241
// TODO: Do this better using AngularJS.
242242
// Perhaps using http://stackoverflow.com/questions/14833326/how-to-set-focus-on-input-field/18295416.

0 commit comments

Comments
 (0)