创建应用

应用的文件系统

file system
App (root)
├─ main.go
└─ app.yml

配置

app.yml
hello:
    message: "hello langgo"

创建应用

使用 langgo.Run() 方法调用组件创建应用。

main.go
package main

import (
	"fmt"
	"github.com/langwan/langgo"
	"github.com/langwan/langgo/components/hello"
)

func main() {
	langgo.Run(&hello.Instance{})
	fmt.Println(hello.Get().Message)
}
output
hello langgo

Last updated