Skip to content

Commit

Permalink
fix test-explorer monaco editor ui
Browse files Browse the repository at this point in the history
  • Loading branch information
xhd2015 committed May 24, 2024
1 parent c60db69 commit 310d0d4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
4 changes: 2 additions & 2 deletions cmd/xgo/runtime_gen/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

const VERSION = "1.0.37"
const REVISION = "4e124e7cc78b77dd490a81bc8db6d8ebdc7c7837+1"
const NUMBER = 236
const REVISION = "c60db693248f3308d29cd43a95b71de835346d50+1"
const NUMBER = 237

// these fields will be filled by compiler
const XGO_VERSION = ""
Expand Down
12 changes: 7 additions & 5 deletions cmd/xgo/runtime_gen/mock/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import (
"github.com/xhd2015/xgo/runtime/trap"
)

// Patch replaces `fn` with `replacer` in current goroutine,
// it returns a cleanup function to remove `replacer`.
// the `replacer` will be automatically cleared when current
// gorotuine exits if the returned cleanup function is not
// called.
// Patch replaces `fn` with `replacer` in current goroutine.
// You do not have to manually clean up the replacer, as
// xgo will automatically clear the replacer when
// current gorotuine exits.
// However, if you want to clear the replacer earlier,
// this function returns a clean up function that can be
// used to clear the replacer.
func Patch(fn interface{}, replacer interface{}) func() {
if fn == nil {
panic("fn cannot be nil")
Expand Down
4 changes: 2 additions & 2 deletions cmd/xgo/test-explorer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
</body>
<!--after body because document.body may be null-->
<!--available in CN and Global-->
<script src="https://cdn.jsdelivr.net/npm/xgo-explorer@0.0.4/index.js"></script>
<!-- <script src="http://127.0.0.1:8080/npm-publish/index.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/xgo-explorer@0.0.7/index.js"></script>
<!-- <script src="http://127.0.0.1:8081/npm-publish/index.js"></script> -->
</html>
6 changes: 6 additions & 0 deletions cmd/xgo/test-explorer/test_explorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ func handle(opts *Options) error {
server := &http.ServeMux{}
var url string
server.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
uri := r.RequestURI
if uri != "" && uri != "/" {
w.WriteHeader(404)
w.Write([]byte("requested source not found:" + uri))
return
}
w.Header().Set("Content-Type", "text/html")
w.Write([]byte(strings.ReplaceAll(indexHTML, apiPlaceholder, url)))
})
Expand Down
4 changes: 2 additions & 2 deletions cmd/xgo/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import "fmt"

const VERSION = "1.0.37"
const REVISION = "4e124e7cc78b77dd490a81bc8db6d8ebdc7c7837+1"
const NUMBER = 236
const REVISION = "c60db693248f3308d29cd43a95b71de835346d50+1"
const NUMBER = 237

func getRevision() string {
revSuffix := ""
Expand Down
4 changes: 2 additions & 2 deletions runtime/core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

const VERSION = "1.0.37"
const REVISION = "4e124e7cc78b77dd490a81bc8db6d8ebdc7c7837+1"
const NUMBER = 236
const REVISION = "c60db693248f3308d29cd43a95b71de835346d50+1"
const NUMBER = 237

// these fields will be filled by compiler
const XGO_VERSION = ""
Expand Down
12 changes: 7 additions & 5 deletions runtime/mock/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import (
"github.com/xhd2015/xgo/runtime/trap"
)

// Patch replaces `fn` with `replacer` in current goroutine,
// it returns a cleanup function to remove `replacer`.
// the `replacer` will be automatically cleared when current
// gorotuine exits if the returned cleanup function is not
// called.
// Patch replaces `fn` with `replacer` in current goroutine.
// You do not have to manually clean up the replacer, as
// xgo will automatically clear the replacer when
// current gorotuine exits.
// However, if you want to clear the replacer earlier,
// this function returns a clean up function that can be
// used to clear the replacer.
func Patch(fn interface{}, replacer interface{}) func() {
if fn == nil {
panic("fn cannot be nil")
Expand Down

0 comments on commit 310d0d4

Please sign in to comment.