Giter VIP home page Giter VIP logo

Comments (5)

ch3nnn avatar ch3nnn commented on July 17, 2024 1

env 是基于 flag 封装的设置项目环境包,通过配置 -env 参数进行指定使用哪个配置文件。

这里如果不指定加载配置文件, 服务会自己加载webstack-go/configs/fat_configs.toml 这个配置文件的

env

env各文件表示含义

  • -env dev,表示设置为开发环境,使用 configs/dev_configs.toml
  • -env fat,表示设置为开发环境,使用 configs/fat_configs.toml
  • -env uat,表示设置为预上线环境,使用 configs/uat_configs.toml
  • -env pro,表示设置为正式环境,使用 configs/pro_configs.toml
  • -env docker, 表示设置为 docker 容器环境,使用 configs/docker_configs.toml

示例

// 设置项目为测试环境, 读取 configs/fat_configs.toml 配置文件
$ go run main.go -env fat

// 获取当前的环境
fmt.Println(env.Active().Value())  // 输出:fat

参考

go-gin-api 项目 Env 文档

from webstack-go.

wjloves avatar wjloves commented on July 17, 2024

感谢大佬回复,我用的宝塔面板只能运行go build后的编译文件 ,运行时就提示这个env错误... 在服务运行go run main.go后 初始化页面 /install/execute 又提示{"code":10116,"message":"写入配置文件失败"} 我把所有文件都chmod 777了 还是不行 - - 我再研究研究 - -

from webstack-go.

ch3nnn avatar ch3nnn commented on July 17, 2024

刚刚我试了一下去掉写权限webstack-go/configs/ , 会报出写入配置文件失败, 建议检查一下webstack-go/configs/文件夹和_configs.toml所有配置文件权限是否分配

from webstack-go.

jihanlingyu avatar jihanlingyu commented on July 17, 2024

Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause 跟mysql版本有关系么

from webstack-go.

ch3nnn avatar ch3nnn commented on July 17, 2024

表定义不正确;在 DEFAULT 或 ON UPDATE 子句中只能有一个带有 CURRENT_TIMESTAMP 的 TIMESTAMP 列

建议使用 mysql 5.7 版本 @jihanlingyu

from webstack-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.