<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 功能強大 支持多語言、二開方便! 廣告
                [TOC] ## 命令 ``` -a 強制重建已經更新的軟件包 -n 打印命令,但不運行它們 -p n 指定構建時候cpu的核數.默認為當前cpu的核數 -race 啟用數據競爭檢測 -msan 使用內存清除器啟用互操作。只支持Linux -v 打印出那些被編譯時的代碼包的名字 -work 打印出編譯時生成的臨時工作目錄的路徑,并在編譯結束時保留它。 在默認情況下,編譯結束時會刪除該目錄 -x 與-n 類似,但是會執行 -asmflags '[pattern=]arg list' 此標記可以后跟另外一些標記,如-D、-I、-S等。 這些后跟的標記用于控制Go語言編譯器編譯匯編語言文件時的行為 -buildmode mode 指定編譯模式,"go help buildmode"查看更多 -compiler name 要使用的編譯器的名稱,如在運行時。編譯器( "gccgo"或 "gc") -gccgoflags '[pattern=]arg list' 指定需要傳遞給gccgo編譯器或鏈接器的標記的列表 -gcflags '[pattern=]arg list' 指定需要傳遞給go tool compile命令的標記的列表 -ldflags '[pattern=]arg list' 指定需要傳遞給go tool link命令的標記的列表 -linkshared 此標記用于與-buildmode=shared一同使用 在此之上進行鏈接操作 -mod mode module 下載模式: (readonly, vendor, or mod.) 通過 'go help modules' 查看更多 -pkgdir dir 指定一個目錄,并從改目錄下加載編譯好的.a 文件, 并把編譯可能產生新的 .a 文件放入到該目錄中 -tags tag,list 指定在實際編譯期間需要受理的編譯標簽(也可被稱為編譯約束)的列表 -trimpath -toolexec 'cmd args' 去自定義在編譯期間使用一些Go語言自帶工具(如vet、asm等)的方式 ``` ## 實例 ### -race 查看數據競爭 ### 不出現dos窗口 ``` go build -ldflags="-H windowsgui" one.go -H 程序從后臺運行,不出現dos窗口 ``` ### 檢查邊界 <details> <summary>main.go</summary> ``` package main func f1(s []int) { _ = s[0] // line 5: bounds check _ = s[1] // line 6: bounds check _ = s[2] // line 7: bounds check } func f2(s []int) { _ = s[2] // line 11: bounds check _ = s[1] // line 12: bounds check eliminated! _ = s[0] // line 13: bounds check eliminated! } func f3(s []int, index int) { _ = s[index] // line 17: bounds check _ = s[index] // line 18: bounds check eliminated! } func f4(a [5]int) { _ = a[4] // line 22: bounds check eliminated! } func main() {} ``` </details> <br/> 執行 ``` > go build -gcflags="-d=ssa/check_bce/debug=1" main.go ./example1.go:5: Found IsInBounds ./example1.go:6: Found IsInBounds ./example1.go:7: Found IsInBounds ./example1.go:11: Found IsInBounds ./example1.go:17: Found IsInBounds ``` ### 蹤包init函數的消耗 ``` $go build $GODEBUG=inittrace=1 ./helloworld init internal/bytealg @0.006 ms, 0 ms clock, 0 bytes, 0 allocs init runtime @0.037 ms, 0.031 ms clock, 0 bytes, 0 allocs init errors @0.29 ms, 0.005 ms clock, 0 bytes, 0 allocs init math @0.31 ms, 0 ms clock, 0 bytes, 0 allocs init strconv @0.33 ms, 0.002 ms clock, 32 bytes, 2 allocs init sync @0.35 ms, 0.003 ms clock, 16 bytes, 1 allocs init unicode @0.37 ms, 0.10 ms clock, 24568 bytes, 30 allocs init reflect @0.49 ms, 0.002 ms clock, 0 bytes, 0 allocs init io @0.51 ms, 0.003 ms clock, 144 bytes, 9 allocs ... ```
                  <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>

                              哎呀哎呀视频在线观看