github.com/gogf/gf@v1.16.9/.example/os/gview/hot_update/gview_hot_update.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"time"
     6  
     7  	"github.com/gogf/gf/frame/g"
     8  	"github.com/gogf/gf/os/gtime"
     9  )
    10  
    11  func main() {
    12  	v := g.View()
    13  	v.SetPath(`D:\Workspace\Go\GOPATH\src\gitee.com\johng\gf\geg\os\gview`)
    14  	gtime.SetInterval(time.Second, func() bool {
    15  		b, _ := v.Parse("gview.tpl", nil)
    16  		fmt.Println(string(b))
    17  		return true
    18  	})
    19  	select {}
    20  }