chore: reformat go

main
sudo pacman -Syu 2023-06-10 11:15:10 +07:00
parent ce2cd77bbe
commit fab273aa7e
2 changed files with 33 additions and 25 deletions

View File

@ -139,10 +139,17 @@
<pre><span class="pl-k">RUN</span> CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOAMD64=v3 go build -o ./app -tags timetzdata -trimpath -ldflags=<span class="pl-s">"-s -w"</span> .</pre> <pre><span class="pl-k">RUN</span> CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOAMD64=v3 go build -o ./app -tags timetzdata -trimpath -ldflags=<span class="pl-s">"-s -w"</span> .</pre>
</div> </div>
<p>This is where I build Go program.</p> <p>This is where I build Go program.</p>
<p> <ul>
<code>CGO_ENABLED=0</code> because I don't want to mess with C libraries. <li>
<code>CGO_ENABLED=0</code> because I don't want to mess with C
libraries.
</li>
<li>
<code>GOOS=linux GOARCH=amd64</code> is easy to explain, Linux with <code>GOOS=linux GOARCH=amd64</code> is easy to explain, Linux with
x86-64. <code>GOAMD64=v3</code> is new since x86-64.
</li>
<li>
<code>GOAMD64=v3</code> is new since
<a href="https://go.dev/doc/go1.18#amd64" rel="nofollow">Go 1.18</a>, I <a href="https://go.dev/doc/go1.18#amd64" rel="nofollow">Go 1.18</a>, I
use v3 because I read about AMD64 version in use v3 because I read about AMD64 version in
<a <a
@ -150,12 +157,14 @@
rel="nofollow" rel="nofollow"
>Arch Linux rfcs</a >Arch Linux rfcs</a
>. TLDR's newer computers are already x86-64-v3. >. TLDR's newer computers are already x86-64-v3.
</p> </li>
<p> <li>
<code>-tags timetzdata</code> to embed timezone database in case base <code>-tags timetzdata</code> to embed timezone database in case base
image does not have. <code>-trimpath</code> to support reproduce build. image does not have.
<code>-ldflags="-s -w"</code> to strip debugging information. </li>
</p> <li><code>-trimpath</code> to support reproduce build.</li>
<li><code>-ldflags="-s -w"</code> to strip debugging information.</li>
</ul>
<div class="highlight highlight-source-dockerfile"> <div class="highlight highlight-source-dockerfile">
<pre><span class="pl-k">FROM</span> gcr.io/distroless/base-debian11 <pre><span class="pl-k">FROM</span> gcr.io/distroless/base-debian11

View File

@ -74,14 +74,13 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOAMD64=v3 go build -o ./app -tags tim
This is where I build Go program. This is where I build Go program.
`CGO_ENABLED=0` because I don't want to mess with C libraries. - `CGO_ENABLED=0` because I don't want to mess with C libraries.
`GOOS=linux GOARCH=amd64` is easy to explain, Linux with x86-64. - `GOOS=linux GOARCH=amd64` is easy to explain, Linux with x86-64.
`GOAMD64=v3` is new since [Go 1.18](https://go.dev/doc/go1.18#amd64), - `GOAMD64=v3` is new since [Go 1.18](https://go.dev/doc/go1.18#amd64),
I use v3 because I read about AMD64 version in [Arch Linux rfcs](https://gitlab.archlinux.org/archlinux/rfcs/-/blob/master/rfcs/0002-march.rst). TLDR's newer computers are already x86-64-v3. I use v3 because I read about AMD64 version in [Arch Linux rfcs](https://gitlab.archlinux.org/archlinux/rfcs/-/blob/master/rfcs/0002-march.rst). TLDR's newer computers are already x86-64-v3.
- `-tags timetzdata` to embed timezone database in case base image does not have.
`-tags timetzdata` to embed timezone database in case base image does not have. - `-trimpath` to support reproduce build.
`-trimpath` to support reproduce build. - `-ldflags="-s -w"` to strip debugging information.
`-ldflags="-s -w"` to strip debugging information.
```Dockerfile ```Dockerfile
FROM gcr.io/distroless/base-debian11 FROM gcr.io/distroless/base-debian11