gopherjs / gopherjs.github.io

GopherJS Playground
https://gopherjs.github.io/playground/
23 stars 12 forks source link

Playground: More user friendly scheme for accessing raw snippet. #57

Open dmitshur opened 7 years ago

dmitshur commented 7 years ago

@dominikh made a valid observation that the GopherJS playground is currently missing a certain feature of the Go playground. The ability to add a ".go" suffix to the playground URL and get a raw snippet. This is useful to be able to curl the snippet to a remote machine, for example.

Compare, Go playground URLs:

https://play.golang.org/p/v3rrZLwEUC https://play.golang.org/p/v3rrZLwEUC.go

GopherJS playground URLs:

http://www.gopherjs.org/playground/#/hy-CTQOoiM http://www.gopherjs.org/playground/#/hy-CTQOoiM.go - does not work http://snippets.gopherjs.org/p/hy-CTQOoiM - works, but is not user friendly. also doesn't have .go suffix, so requires the filename to be changed when downloading.

Thanks @dominikh for reporting.