-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[blink GUI] windowsgui flag flash console windows. #5
Comments
@wsteel seems like that one posted on
The problem does not derives from Iris or even blink or gin, it was a Go bug which will be fixed on the next release. You posted a misdirection sentence package main
import (
"log"
"net/http"
"github.com/gin-gonic/gin"
"github.com/kataras/iris/v12"
"github.com/raintean/blink"
)
const (
withNethttp uint8 = iota
withIris
withGin
)
const (
runWith = withGin
addr = "127.0.0.1:8080"
)
func main() {
exit := make(chan bool)
blink.SetDebugMode(true)
errv := blink.InitBlink()
if errv != nil {
log.Fatal(errv)
}
go func() {
switch runWith {
case withIris:
app := iris.New()
app.Get("/ping", func(ctx iris.Context) {
ctx.WriteString("pong")
})
app.Run(iris.Addr(addr))
case withGin:
gin.SetMode(gin.ReleaseMode)
router := gin.New()
router.GET("/ping", func(ctx *gin.Context) {
ctx.String(http.StatusOK, "pong")
})
router.Run(addr)
default:
mux := http.NewServeMux()
mux.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet {
http.Error(w, http.StatusText(http.StatusMethodNotAllowed), http.StatusMethodNotAllowed)
return
}
w.Write([]byte("pong"))
})
http.ListenAndServe(addr, mux)
}
}()
view := blink.NewWebView(false, 1366, 920)
view.LoadURL(addr + "/ping")
view.SetWindowTitle("test")
view.MoveToCenter()
view.ShowWindow()
view.On("destroy", func(_ *blink.WebView) {
close(exit)
})
<-exit
} Solution Changing the GOPATH to the correct capitalization form e.g. "C:\Users$name\go" instead of "c:\users$name\go" is a workaround for on go 1.10.3. As you can see I am trying to help you even if it's not an Iris-relative issue. Please remember this, not everyone does that. Thanks, |
thanks for your help. try this code , just drop iris ...
|
OK that was a tough one, but I found the origin of the problem, it's not iris itself but a dependency that golog uses, the pio/terminal/terminal_windows.go Lines 31 to 35 in ea782b3
This is now fixed. However, in order to see that in action, you have to modify your go mod to update Your contribution @wsteel, especially with your last comment, was priceless. Thank you. |
Describe the bug
when i build a local web application on windows, use build cmd
,when i run , it's strange. first show a console windows, then the console window closed . console window will show twice. final my windows show out.
i don't kown how to block the console window's show . so need help.
when i use gin , this's ok . no console window show out.
To Reproduce
Steps to reproduce the behavior:
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: