<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 讀配置參數 設置完配置參數后,就可以使用`config.Env`方法讀取配置了,例如: ``` config.Env("APP_NAME", "production") ``` 但是通常我們不會直接讀取`.env`文件的內容,都是在`config`下復寫一些,那么想讀取`config`下指定文件中如`app.go`文件中的指定參數可以用下面方式: ``` // 第一個參數 path 允許使用點式獲取,如:app.name // 第二個參數允許傳參默認值 config.Get("app.port") ``` 獲取 String 類型的配置信息 ~~~ config.GetString("redis.username"), ~~~ 獲取 Int 類型的配置信息 ~~~ config.GetInt("captcha.height") ~~~ 獲取 float64 類型的配置信息 ~~~ config.GetFloat64("captcha.maxskew") ~~~ 獲取 Int64 類型的配置信息 ~~~ config.GetInt64("jwt.debug_expire_time") ~~~ 獲取 Uint 類型的配置信息 ``` config.GetUint("jwt.debug_expire_time") ``` 獲取 Bool 類型的配置信息 ~~~ config.GetBool("log.compress") ~~~ 獲取配置文件結構數據,通常獲取二級后的配置文件結構 ~~~ config.GetStringMapString("mail.smtp") ~~~ 如果要讀取二級配置,可以使用: ~~~go // mail是config目錄下的文件名,smtp是配置文件內容中的鍵 config.GetStringMapString("mail.smtp")["host"] ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看