You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gateway.go
    path of file: ./repos/b0pass/core/gateway
    
    the code of the file until where you have to start completion: package gateway

import (
	"b0go/core/engine"
	"bytes"
	"embed"
	"fmt"
	"io/fs"
	"net/http"
	"os"
	"path/filepath"
	"runtime"

	"github.com/BurntSushi/toml"
	"github.com/gin-gonic/gin"
	"github.com/logrusorgru/aurora"
)

type AppConfig struct {
	ListenAddr string
	Domain     string
	Password   string //密码
	Live       bool
	Debug      bool
}

var (
	appId  = "gateway"
	config = new(AppConfig)

	docsPath string
	//go:embed doc/dist
	docsPathFS embed.FS

	//go:embed ui/dist
	uiFS embed.FS
)

func init() {
	uiDist, _ := fs.Sub(uiFS, "ui/
    
func addAppStaticRoute(live bool) {
	//默认首页
	/*engine.Gin.GET("/", func(c *gin.Context) {
		c.Request.URL.Path = "/docs/index.html"
		engine.Gin.HandleContext(c)
	})*/
	if live {
		if config.Debug {
			//docs
			engine.Gin.Static("/dev/doc", docsPath)
		}
		//app/appid
		for name, config := range engine.App {
			engine.Gin.Static(fmt.Sprintf("/app/%s", name), config.UIDir)
		}
	} else {
		if config.Debug {
			//docs
			docDist, _ := fs.Sub(docsPathFS, "doc/dist")
			engine.Gin.StaticFS("/dev/doc", http.FS(docDist))
		}
		//app/appid
		for name, config := range engine.App {
			engine.Gin.StaticFS(fmt.Sprintf("/app/%s", name), http.FS(config.UIFS))
		}
	}
}