代码拉取完成,页面将自动刷新
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><meta><title>Go:fmt.Printf() 格式化占位符 - Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节.</title><link rel="manifest" href="/manifest.json"><meta name="application-name" content="Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节."><meta name="msapplication-TileImage" content="/img/favicon.ico"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节."><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="description" content="fmt.Printf() 格式化占位符格式符 fmt.Printf(&quot;%v&quot;, variable)"><meta property="og:type" content="blog"><meta property="og:title" content="Go:fmt.Printf() 格式化占位符"><meta property="og:url" content="https://www.defense.ink/8aaf9686.html"><meta property="og:site_name" content="Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节."><meta property="og:description" content="fmt.Printf() 格式化占位符格式符 fmt.Printf(&quot;%v&quot;, variable)"><meta property="og:locale" content="en_US"><meta property="og:image" content="https://source.unsplash.com/random/800x600/?prinf"><meta property="article:published_time" content="2020-02-26T22:02:00.000Z"><meta property="article:modified_time" content="2024-02-17T03:35:16.587Z"><meta property="article:author" content="Jack Liu"><meta property="article:tag" content="Go"><meta property="article:tag" content="Go-Printf"><meta property="twitter:card" content="summary"><meta property="twitter:image" content="https://source.unsplash.com/random/800x600/?prinf"><script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://www.defense.ink/8aaf9686.html"},"headline":"Go:fmt.Printf() 格式化占位符","image":[],"datePublished":"2020-02-26T22:02:00.000Z","dateModified":"2024-02-17T03:35:16.587Z","author":{"@type":"Person","name":"Jack Liu"},"publisher":{"@type":"Organization","name":"Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节.","logo":{"@type":"ImageObject","url":"https://www.defense.ink/img/logo.svg"}},"description":"fmt.Printf() 格式化占位符格式符 fmt.Printf("%v", variable)"}</script><link rel="canonical" href="https://www.defense.ink/8aaf9686.html"><link rel="alternate" href="/atom.xml" title="Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节." type="application/atom+xml"><link rel="icon" href="/img/favicon.ico"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/font-awesome/5.15.2/css/all.min.css"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"><link rel="stylesheet" href="https://fonts.loli.net/css2?family=Ubuntu:wght@400;600&family=Source+Code+Pro"><link rel="stylesheet" href="/css/default.css"><style>body>.footer,body>.navbar,body>.section{opacity:0}</style><script>!function(){var e=document.createElement("script"),t=(e.src="//hm.baidu.com/hm.js?9f72b89b2ff66be1d913039ecbd3bc14",document.getElementsByTagName("script")[0]);t.parentNode.insertBefore(e,t)}()</script><meta name="msvalidate.01" content="ad0df3c8d20f49daaeb5baa3c9dbfe75"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/cookieconsent/3.1.1/cookieconsent.min.css"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/lightgallery/1.10.0/css/lightgallery.min.css"><link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/justifiedGallery/3.8.1/css/justifiedGallery.min.css"><style>.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#3273dc;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px}</style><script src="https://cdnjs.loli.net/ajax/libs/pace/1.2.4/pace.min.js"></script><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8952360410310192" crossorigin="anonymous"></script><script>!function(){function e(){if(location.hash){Array.from(document.querySelectorAll(".tab-content")).forEach(e=>{e.classList.add("is-hidden")}),Array.from(document.querySelectorAll(".tabs li")).forEach(e=>{e.classList.remove("is-active")});const e=document.querySelector(location.hash),t=(e&&e.classList.remove("is-hidden"),document.querySelector(`a[href="${location.hash}"]`));t&&t.parentElement.classList.add("is-active")}}e(),window.addEventListener("hashchange",e,!1)}()</script><meta name="generator" content="Hexo 6.1.0"></head><body class="is-2-column"><img src="/img/avatar.jpeg" width="0" height="0"><nav class="navbar navbar-main"><div class="container navbar-container"><div class="navbar-brand justify-content-center"><a class="navbar-item navbar-logo" href="/"><img src="/img/logo.svg" alt="Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节." height="28"></a></div><div class="navbar-menu"><div class="navbar-start"><a class="navbar-item" href="/">Home</a><a class="navbar-item" href="/archives">Archives</a><a class="navbar-item" href="/categories">Categories</a><a class="navbar-item" href="/tags">Tags</a><a class="navbar-item" href="/musics">Musics</a><a class="navbar-item" href="/videos">Videos</a><a class="navbar-item" href="/galleries">Galleries</a><a class="navbar-item" href="/about">About</a></div><div class="navbar-end"><a class="navbar-item dark-mode-btn" title="Light|Dark" rel="noopener" onclick="switchDarkMode()"> <i class="fas fa-lightbulb"> </i></a><a class="navbar-item" target="_blank" rel="noopener" title="Musics" href="/musics"><i class="fas fa-music"></i></a><a class="navbar-item" target="_blank" rel="noopener" title="Videos" href="/videos"><i class="fas fa-video"></i></a><a class="navbar-item" target="_blank" rel="noopener" title="WeChat Account (labsec)" href="/about/index/ljq-qrcode.jpeg"><i class="fab fa-weixin"></i></a><a class="navbar-item" target="_blank" rel="noopener" title="Jack Liu GitHub" href="https://github.com/ljq"><i class="fab fa-github"></i></a><a class="navbar-item is-hidden-tablet catalogue" title="Catalogue" href="javascript:;"><i class="fas fa-list-ul"></i></a><a class="navbar-item search" title="Search" href="javascript:;"><i class="fas fa-search"></i></a></div></div></div></nav><section class="section"><div class="container"><div class="columns"><div class="column order-2 column-main is-8-tablet is-8-desktop is-9-widescreen"><div class="card"><div class="card-image"><span class="image is-7by3"><img class="fill" src="https://source.unsplash.com/random/800x600/?prinf" alt="Go:fmt.Printf() 格式化占位符"></span></div><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item">Posted <time datetime="2020-02-26T22:02:00.000Z" title="2/27/2020, 6:02:00 AM">2020-02-27</time></span><span class="level-item">Updated <time datetime="2024-02-17T03:35:16.587Z" title="2/17/2024, 11:35:16 AM">2024-02-17</time></span><span class="level-item"> Jack Liu </span><span class="level-item"><a class="link-muted" href="/categories/Go/">Go</a></span><span class="level-item">7 minutes read (About 1040 words)</span></div></div><h1 class="title is-3 is-size-4-mobile">Go:fmt.Printf() 格式化占位符</h1><div class="content"><h3 id="fmt-Printf-格式化占位符"><a href="#fmt-Printf-格式化占位符" class="headerlink" title="fmt.Printf() 格式化占位符"></a>fmt.Printf() 格式化占位符</h3><h4 id="格式符-fmt-Printf-quot-v-quot-variable"><a href="#格式符-fmt-Printf-quot-v-quot-variable" class="headerlink" title="格式符 fmt.Printf("%v", variable)"></a>格式符 <code>fmt.Printf("%v", variable)</code></h4><span id="more"></span><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br></pre></td><td class="code"><pre><span class="line"># 【通用占位符】</span><br><span class="line"> v 值的默认格式。</span><br><span class="line"> %+v 添加字段名(如结构体)</span><br><span class="line"> %#v 相应值的Go语法表示</span><br><span class="line"> %T 相应值的类型的Go语法表示</span><br><span class="line"> %% 字面上的百分号,并非值的占位符 </span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【布尔值】</span><br><span class="line"> %t true 或 false</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【整数值】</span><br><span class="line"> %b 二进制表示</span><br><span class="line"> %c 相应Unicode码点所表示的字符</span><br><span class="line"> %d 十进制表示</span><br><span class="line"> %o 八进制表示</span><br><span class="line"> %q 单引号围绕的字符字面值,由Go语法安全地转义</span><br><span class="line"> %x 十六进制表示,字母形式为小写 a-f</span><br><span class="line"> %X 十六进制表示,字母形式为大写 A-F</span><br><span class="line"> %U Unicode格式:U+1234,等同于 "U+%04X"</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【浮点数及复数】</span><br><span class="line"> %b 无小数部分的,指数为二的幂的科学计数法, </span><br><span class="line"> 与 strconv.FormatFloat中的 'b' 转换格式一致。例如 -123456p-78</span><br><span class="line"> %e 科学计数法,例如 -1234.456e+78</span><br><span class="line"> %E 科学计数法,例如 -1234.456E+78</span><br><span class="line"> %f 有小数点而无指数,例如 123.456</span><br><span class="line"> %g 根据情况选择 %e 或 %f 以产生更紧凑的(无末尾的0)输出</span><br><span class="line"> %G 根据情况选择 %E 或 %f 以产生更紧凑的(无末尾的0)输出</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【字符串和bytes的slice表示】</span><br><span class="line"> %s 字符串或切片的无解译字节</span><br><span class="line"> %q 双引号围绕的字符串,由Go语法安全地转义</span><br><span class="line"> %x 十六进制,小写字母,每字节两个字符</span><br><span class="line"> %X 十六进制,大写字母,每字节两个字符</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【指针】</span><br><span class="line"> %p 十六进制表示,前缀 0x</span><br><span class="line"> 这里没有 'u' 标记。若整数为无符号类型,他们就会被打印成无符号的。</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【精度和对齐方式】</span><br><span class="line"> 〔输出最少宽度〕〔.精度〕〔长度〕类型</span><br><span class="line"> "%-md" :左对齐,若m比实际少时,按实际输出。</span><br><span class="line"> "%m.ns":输出m位,取字符串(左起)n位,左补空格,当n>m or m省略时m=n</span><br><span class="line"> "%m.nf":输出浮点数的输出宽度对齐,m为宽度,n为小数点右边数位</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【宽度和精度】</span><br><span class="line"> 指示符(`f')为例:</span><br><span class="line"> %f: 默认宽度和精度 </span><br><span class="line"> %mf 宽度m, 默认精度 </span><br><span class="line"> %.nf 默认宽度, 精度n </span><br><span class="line"> %m.nf 宽度m, 精度n </span><br><span class="line"> %m.f 宽度m, 精度0</span><br><span class="line"> 若遇到浮点数的指示符(`f')的话,它表示小数部分的位数。</span><br><span class="line"> 若遇到浮点数的指示符(`e', `E', `g', `G')的话,它表示有效位数</span><br><span class="line"> 若将精度设为`*'的话,将从参数中提取精度的值</span><br><span class="line"> 整数的指示符(`d', `i', `b', `o', `x', `X', `u')</span><br><span class="line"> 其中对于字符串%s或者浮点类型%f,来说,精度可以截断数据的长度</span><br><span class="line"> "%-md" :左对齐,若m比实际少时,按实际输出。</span><br><span class="line"> "%m.ns":输出m位,取字符串(左起)n位,左补空格,当n>m or m省略时m=n</span><br><span class="line"></span><br><span class="line"># 【显示参数占位符】</span><br><span class="line"> %[2]d, %[1]d 以%d为例:先输出第二个值,再输出第一个值.</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 【特殊格式标识符】</span><br><span class="line"> + 总打印数值的正负号;对于%q(%+q)保证只输出ASCII编码的字符。 </span><br><span class="line"> - 左对齐 </span><br><span class="line"> # 备用格式:</span><br><span class="line"> 为八进制添加前导 0(%#o),</span><br><span class="line"> 为十六进制添加前导 0x(%#x)或0X(%#X),为 %p(%#p)去掉前导 0x;</span><br><span class="line"> 对于 %q,若 strconv.CanBackquote 返回 true,</span><br><span class="line"> 就会打印原始(即反引号围绕的)字符串;</span><br><span class="line"> 如果是可打印字符,%U(%#U)会写出该字符的</span><br><span class="line"> Unicode编码形式(如字符 x 会被打印成 U+0078 'x')。 </span><br><span class="line"> ' ' (空格)为数值中省略的正负号留出空白(% d);</span><br><span class="line"> 以十六进制(% x, % X)打印字符串或切片时,在字节之间用空格隔开 </span><br><span class="line"> 0 填充前导的0而非空格;对于数字,这会将填充移到正负号之后</span><br><span class="line"></span><br></pre></td></tr></table></figure></div><div class="article-licensing box"><div class="licensing-title"><p>Go:fmt.Printf() 格式化占位符</p><p><a href="https://www.defense.ink/8aaf9686.html">https://www.defense.ink/8aaf9686.html</a></p></div><div class="licensing-meta level is-mobile"><div class="level-left"><div class="level-item is-narrow"><div><h6>Author</h6><p>Jack Liu</p></div></div><div class="level-item is-narrow"><div><h6>Posted on</h6><p>2020-02-27</p></div></div><div class="level-item is-narrow"><div><h6>Updated on</h6><p>2024-02-17</p></div></div><div class="level-item is-narrow"><div><h6>Licensed under</h6><p><a class="icons" rel="noopener" target="_blank" title="Creative Commons" href="https://creativecommons.org/"><i class="icon fab fa-creative-commons"></i></a><a class="icons" rel="noopener" target="_blank" title="Attribution" href="https://creativecommons.org/licenses/by/4.0/"><i class="icon fab fa-creative-commons-by"></i></a><a class="icons" rel="noopener" target="_blank" title="Noncommercial" href="https://creativecommons.org/licenses/by-nc/4.0/"><i class="icon fab fa-creative-commons-nc"></i></a></p></div></div></div></div></div><div class="article-tags is-size-7 mb-4"><span class="mr-2">#</span><a class="link-muted mr-2" rel="tag" href="/tags/Go/">Go</a><a class="link-muted mr-2" rel="tag" href="/tags/Go-Printf/">Go-Printf</a></div><div class="sharethis-inline-share-buttons"></div><script src="https://platform-api.sharethis.com/js/sharethis.js#property=627845fc01dad800199bf3d4&product=inline-share-buttons" defer></script></article></div><nav class="post-navigation mt-4 level is-mobile"><div class="level-start"><a class="article-nav-prev level level-item link-muted" href="/2188b831.html"><i class="level-item fas fa-chevron-left"></i><span class="level-item">Go tool pprof性能监控调试工具基本使用说明</span></a></div><div class="level-end"><a class="article-nav-next level level-item link-muted" href="/5767103d.html"><span class="level-item">Jack Liu Golang personal summary combing notes</span><i class="level-item fas fa-chevron-right"></i></a></div></nav><script src="https://cdn.bootcdn.net/ajax/libs/mermaid/8.13.8/mermaid.min.js"></script></div><div class="column column-right is-4-tablet is-4-desktop is-3-widescreen order-3"><div class="card widget" id="toc" data-type="toc"><div class="card-content"><div class="menu"><h3 class="menu-label">Catalogue</h3><ul class="menu-list"><li><a class="level is-mobile" href="#fmt-Printf-格式化占位符"><span class="level-left"><span class="level-item">1</span><span class="level-item">fmt.Printf() 格式化占位符</span></span></a><ul class="menu-list"><li><a class="level is-mobile" href="#格式符-fmt-Printf-quot-v-quot-variable"><span class="level-left"><span class="level-item">1.1</span><span class="level-item">格式符 fmt.Printf("%v", variable)</span></span></a></li></ul></li></ul></div></div><style>#toc .menu-list>li>a.is-active+.menu-list{display:block}#toc .menu-list>li>a+.menu-list{display:none}</style><script src="/js/toc.js" defer></script></div><div class="card widget" data-type="recent-posts"><div class="card-content"><h3 class="menu-label">Recents</h3><article class="media"><figure class="media-left"><a class="image" href="/bafde551.html"><img src="https://source.unsplash.com/random/80x60/?keyboard" alt="macOS Ghostty Terminal Ddefault binding keyboard shortcut key list(Ghostty.org Ghostty 终端默认快捷键列表)"></a></figure><div class="media-content"><p class="date"><time datetime="2025-01-13T14:02:02.000Z">2025-01-13</time></p><p class="title"><a href="/bafde551.html">macOS Ghostty Terminal Ddefault binding keyboard shortcut key list(Ghostty.org Ghostty 终端默认快捷键列表)</a></p><p class="categories"><a href="/categories/macos/">macos</a></p></div></article><article class="media"><figure class="media-left"><a class="image" href="/187f82a.html"><img src="/./static/images/daily/2024-09-28-rszmfdd.jpeg" alt="人是怎样废掉的?"></a></figure><div class="media-content"><p class="date"><time datetime="2024-09-28T11:18:08.000Z">2024-09-28</time></p><p class="title"><a href="/187f82a.html">人是怎样废掉的?</a></p><p class="categories"><a href="/categories/daily/">daily</a> / <a href="/categories/daily/note/">note</a></p></div></article><article class="media"><figure class="media-left"><a class="image" href="/96f1067a.html"><img src="https://source.unsplash.com/random/80x60/?rocky-linux,linux" alt="Rocky Linux系统初始化常用基础命令和工具包的便捷安装脚本(ljq@GitHub)"></a></figure><div class="media-content"><p class="date"><time datetime="2024-07-04T13:47:01.000Z">2024-07-04</time></p><p class="title"><a href="/96f1067a.html">Rocky Linux系统初始化常用基础命令和工具包的便捷安装脚本(ljq@GitHub)</a></p><p class="categories"><a href="/categories/linux/">linux</a> / <a href="/categories/linux/centos/">centos</a></p></div></article><article class="media"><figure class="media-left"><a class="image" href="/93d6d12a.html"><img src="https://source.unsplash.com/random/80x60/?mysql" alt="MySQL 8.0为什么使用utf8mb4_0900_ai_ci默认校对规则,而不使用utf8mb4_general_ci?"></a></figure><div class="media-content"><p class="date"><time datetime="2024-06-19T14:02:02.000Z">2024-06-19</time></p><p class="title"><a href="/93d6d12a.html">MySQL 8.0为什么使用utf8mb4_0900_ai_ci默认校对规则,而不使用utf8mb4_general_ci?</a></p><p class="categories"><a href="/categories/Database/">Database</a></p></div></article><article class="media"><figure class="media-left"><a class="image" href="/de20129e.html"><img src="https://source.unsplash.com/random/80x60/?google" alt="《如何创建一家像谷歌一样的公司》(How to start Google)- paulgraham - 转载"></a></figure><div class="media-content"><p class="date"><time datetime="2024-03-27T16:51:01.000Z">2024-03-28</time></p><p class="title"><a href="/de20129e.html">《如何创建一家像谷歌一样的公司》(How to start Google)- paulgraham - 转载</a></p><p class="categories"><a href="/categories/reprinted-articles/">reprinted-articles</a></p></div></article></div></div><div class="card widget" data-type="categories"><div class="card-content"><div class="menu"><h3 class="menu-label">Categories</h3><ul class="menu-list"><li><a class="level is-mobile" href="/categories/AI/"><span class="level-start"><span class="level-item">AI</span></span><span class="level-end"><span class="level-item tag">1</span></span></a><ul><li><a class="level is-mobile" href="/categories/AI/painting/"><span class="level-start"><span class="level-item">painting</span></span><span class="level-end"><span class="level-item tag">1</span></span></a><ul><li><a class="level is-mobile" href="/categories/AI/painting/Controlnet/"><span class="level-start"><span class="level-item">Controlnet</span></span><span class="level-end"><span class="level-item tag">1</span></span></a><ul><li><a class="level is-mobile" href="/categories/AI/painting/Controlnet/Drawing/"><span class="level-start"><span class="level-item">Drawing</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li></ul></li></ul></li></ul></li><li><a class="level is-mobile" href="/categories/Algorithm/"><span class="level-start"><span class="level-item">Algorithm</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/Database/"><span class="level-start"><span class="level-item">Database</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/GIT/"><span class="level-start"><span class="level-item">GIT</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/Go/"><span class="level-start"><span class="level-item">Go</span></span><span class="level-end"><span class="level-item tag">24</span></span></a></li><li><a class="level is-mobile" href="/categories/JavaScript/"><span class="level-start"><span class="level-item">JavaScript</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/clang/"><span class="level-start"><span class="level-item">clang</span></span><span class="level-end"><span class="level-item tag">5</span></span></a></li><li><a class="level is-mobile" href="/categories/daily/"><span class="level-start"><span class="level-item">daily</span></span><span class="level-end"><span class="level-item tag">3</span></span></a><ul><li><a class="level is-mobile" href="/categories/daily/note/"><span class="level-start"><span class="level-item">note</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li></ul></li><li><a class="level is-mobile" href="/categories/distributed/"><span class="level-start"><span class="level-item">distributed</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/history-of-programing/"><span class="level-start"><span class="level-item">history-of-programing</span></span><span class="level-end"><span class="level-item tag">1</span></span></a><ul><li><a class="level is-mobile" href="/categories/history-of-programing/daily/"><span class="level-start"><span class="level-item">daily</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li></ul></li><li><a class="level is-mobile" href="/categories/linux/"><span class="level-start"><span class="level-item">linux</span></span><span class="level-end"><span class="level-item tag">6</span></span></a><ul><li><a class="level is-mobile" href="/categories/linux/centos/"><span class="level-start"><span class="level-item">centos</span></span><span class="level-end"><span class="level-item tag">3</span></span></a></li><li><a class="level is-mobile" href="/categories/linux/debian/"><span class="level-start"><span class="level-item">debian</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/linux/firewalld/"><span class="level-start"><span class="level-item">firewalld</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/linux/openssl/"><span class="level-start"><span class="level-item">openssl</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li></ul></li><li><a class="level is-mobile" href="/categories/lua/"><span class="level-start"><span class="level-item">lua</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/macos/"><span class="level-start"><span class="level-item">macos</span></span><span class="level-end"><span class="level-item tag">5</span></span></a></li><li><a class="level is-mobile" href="/categories/php/"><span class="level-start"><span class="level-item">php</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li><li><a class="level is-mobile" href="/categories/reprinted-articles/"><span class="level-start"><span class="level-item">reprinted-articles</span></span><span class="level-end"><span class="level-item tag">1</span></span></a></li></ul></div></div></div><div class="card widget" data-type="tags"><div class="card-content"><div class="menu"><h3 class="menu-label">Tags</h3><div class="field is-grouped is-grouped-multiline"><div class="control"><a class="tags has-addons" href="/tags/AI/"><span class="tag">AI</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/CDN/"><span class="tag">CDN</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Cloud-Distributed/"><span class="tag">Cloud-Distributed</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Distributed-Systems/"><span class="tag">Distributed-Systems</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/GIT/"><span class="tag">GIT</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/GO%E6%96%B9%E6%B3%95%E5%80%BC/"><span class="tag">GO方法值</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/GPG/"><span class="tag">GPG</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/GPG2/"><span class="tag">GPG2</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/GUI/"><span class="tag">GUI</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Ghostty/"><span class="tag">Ghostty</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go/"><span class="tag">Go</span><span class="tag">24</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-Summary-notes/"><span class="tag">Go Summary notes</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-null-judge/"><span class="tag">Go null judge</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-Struct-Method-Receiver/"><span class="tag">Go(Struct|Method|Receiver)</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-map/"><span class="tag">Go(map)</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-new-make-struct/"><span class="tag">Go(new,make,struct{})</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-string/"><span class="tag">Go(string)</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-Polymorphism/"><span class="tag">Go-Polymorphism</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-Printf/"><span class="tag">Go-Printf</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-chain-operation/"><span class="tag">Go-chain-operation</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Go-init/"><span class="tag">Go-init()</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Google/"><span class="tag">Google</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/JS/"><span class="tag">JS</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/JSON/"><span class="tag">JSON</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/JavaScript/"><span class="tag">JavaScript</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Movie/"><span class="tag">Movie</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/Note-The-Legend-of-1900/"><span class="tag">Note The Legend of 1900</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/OpenSSH/"><span class="tag">OpenSSH</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/VIM/"><span class="tag">VIM</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/VIM-Author/"><span class="tag">VIM Author</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/ansi-lib/"><span class="tag">ansi-lib</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/banner/"><span class="tag">banner</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/centos7/"><span class="tag">centos7</span><span class="tag">2</span></a></div><div class="control"><a class="tags has-addons" href="/tags/chattr/"><span class="tag">chattr</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/clang/"><span class="tag">clang</span><span class="tag">6</span></a></div><div class="control"><a class="tags has-addons" href="/tags/cli/"><span class="tag">cli</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/daily/"><span class="tag">daily</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/debian/"><span class="tag">debian</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/firewalld/"><span class="tag">firewalld</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/format/"><span class="tag">format</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/func/"><span class="tag">func</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/go/"><span class="tag">go</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/go-pprof/"><span class="tag">go-pprof</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/goroutine/"><span class="tag">goroutine</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/hexo/"><span class="tag">hexo</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/homebrew/"><span class="tag">homebrew</span><span class="tag">3</span></a></div><div class="control"><a class="tags has-addons" href="/tags/interface/"><span class="tag">interface</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/io/"><span class="tag">io</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/laravel/"><span class="tag">laravel</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/laravel-artisan/"><span class="tag">laravel-artisan</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/linux/"><span class="tag">linux</span><span class="tag">5</span></a></div><div class="control"><a class="tags has-addons" href="/tags/lua/"><span class="tag">lua</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/macos/"><span class="tag">macos</span><span class="tag">3</span></a></div><div class="control"><a class="tags has-addons" href="/tags/macro/"><span class="tag">macro</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/motd/"><span class="tag">motd</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/mysql/"><span class="tag">mysql</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/mysql8-0/"><span class="tag">mysql8.0</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/mysql8-x/"><span class="tag">mysql8.x</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/neofetch/"><span class="tag">neofetch</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/nginx/"><span class="tag">nginx</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/package-time/"><span class="tag">package time</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/php/"><span class="tag">php</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/pointer/"><span class="tag">pointer</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/reflect%E5%8F%8D%E5%B0%84/"><span class="tag">reflect反射</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/rocky/"><span class="tag">rocky</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/rocky-linux/"><span class="tag">rocky-linux</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/rocky-linux-tools/"><span class="tag">rocky-linux-tools</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/rsync/"><span class="tag">rsync</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/services/"><span class="tag">services</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/slice%E5%88%87%E7%89%87%E6%9C%AC%E8%B4%A8/"><span class="tag">slice切片本质</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/stable-diffusion-webui/"><span class="tag">stable-diffusion-webui</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/struct/"><span class="tag">struct</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/switch/"><span class="tag">switch</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/systemd-service/"><span class="tag">systemd-service</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/terminal/"><span class="tag">terminal</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/travel/"><span class="tag">travel</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/type/"><span class="tag">type</span><span class="tag">2</span></a></div><div class="control"><a class="tags has-addons" href="/tags/type%E5%85%B3%E9%94%AE%E8%AF%8D%E6%80%BB%E7%BB%93/"><span class="tag">type关键词总结</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/utf8mb4/"><span class="tag">utf8mb4</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/utf8mb4-0900-ai-ci/"><span class="tag">utf8mb4_0900_ai_ci</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/utf8mb4-general-ci/"><span class="tag">utf8mb4_general_ci</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E4%BA%BA%E7%94%9F/"><span class="tag">人生</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E6%97%A5%E5%B8%B8/"><span class="tag">日常</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E7%94%9F%E6%B4%BB/"><span class="tag">生活</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E8%BD%AC%E8%BD%BD/"><span class="tag">转载</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%BD%93%E7%B3%BB/"><span class="tag">配置文件体系</span><span class="tag">1</span></a></div><div class="control"><a class="tags has-addons" href="/tags/%E9%98%B2%E7%81%AB%E5%A2%99/"><span class="tag">防火墙</span><span class="tag">1</span></a></div></div></div></div></div><div class="card widget" data-type="clustrmaps"><div class="card-content"><div class="menu"><h3 class="menu-label">CLUSTRMAPS</h3></div><nav class="level"><div class="level-item has-text-centered flex-shrink-1"><div style="margin-top:10px"><script type="text/javascript" id="clustrmaps" src="https://cdn.clustrmaps.com/map_v2.js?cl=ffffff&w=250&t=n&d=xb7wV_PHYtl9KaSZpQgP9CLUNrXlqm480vcarJmX2A0&co=2d78ad&cmo=3acc3a&cmn=ff5353&ct=ffffff"></script><script type="text/javascript" id="clstr_globe" src="https://clustrmaps.com/globe.js?d=xb7wV_PHYtl9KaSZpQgP9CLUNrXlqm480vcarJmX2A0"></script></div></div></nav></div></div><div class="card widget" data-type="adsense"><div class="card-content"><div class="menu"><h3 class="menu-label">Advertisement</h3><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-8952360410310192" data-ad-slot="1345698037" data-ad-format="auto" data-full-width-responsive="true"></ins><script>(adsbygoogle=window.adsbygoogle||[]).push({})</script></div></div></div></div></div></div></section><footer class="footer" style="padding:1rem 1.5rem 0"><div class="container"><div class="level"><div class="level-start"><p class="is-size-7"><a class="footer-logo" style="margin-right:10px" href="/"><img src="/img/logo.svg" alt="Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节." height="16" style="max-height:1.25rem"></a><a href="http://beian.miit.gov.cn" target="_blank">鲁ICP备2023051700号</a> <span>© 2025 Jack Liu</span> <span style="color:#e0e0e0">Powered by <a style="color:#e0e0e0" href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a style="color:#e0e0e0" href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a></span><script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> <span id="busuanzi_container_site_pv">Total Visits Counts: <span id="busuanzi_value_site_pv"></span>.</span></p></div><div class="level-end"><div class="field has-addons"><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Creative Commons" href="https://creativecommons.org/"><i class="fab fa-creative-commons"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Attribution 4.0 International" href="https://creativecommons.org/licenses/by/4.0/"><i class="fab fa-creative-commons-by"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Jack Liu'GitHub" href="https://github.com/ljq"><i class="fab fa-github"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="ref.wdft.com" href="https://ref.wdft.com"><i class="fas fa-cloud"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="cook.wdft.com" href="https://cook.wdft.com"><i class="fas fa-coffee"></i></a></p> <span><i class="fas fa-link">BlogRoll:</i></span><p class="control" style="color:#26c1fa"><a class="button is-transparent" target="_blank" rel="noopener" title="Quick Reference" href="https://ref.wdft.com">Quick Reference</a></p><p class="control" style="color:#26c1fa"><a class="button is-transparent" target="_blank" rel="noopener" title="Cook" href="https://cook.wdft.com">Cook</a></p></div></div></div></div></footer><script src="https://cdnjs.loli.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script><script src="https://cdnjs.loli.net/ajax/libs/moment.js/2.22.2/moment-with-locales.min.js"></script><script src="https://cdnjs.loli.net/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" defer></script><script>moment.locale("en")</script><script>var IcarusThemeSettings={article:{highlight:{clipboard:!0,fold:"unfolded"}}}</script><script src="/js/column.js"></script><script src="/js/animation.js"></script><a id="back-to-top" title="Back to top" href="javascript:;"><i class="fas fa-chevron-up"></i></a><script src="/js/back_to_top.js" defer></script><script src="/js/switchDarkMode.js" defer></script><script src="/js/toutiaoSEO.js" defer></script><script src="https://cdnjs.loli.net/ajax/libs/cookieconsent/3.1.1/cookieconsent.min.js" defer></script><script>window.addEventListener("load",()=>{window.cookieconsent.initialise({type:"info",theme:"edgeless",static:!1,position:"bottom-left",content:{message:"This website uses cookies to improve your experience.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",policy:"Cookie Policy",href:"https://www.cookiesandyou.com/"},palette:{popup:{background:"#edeff5",text:"#838391"},button:{background:"#4b81e8"}}})})</script><script src="https://cdnjs.loli.net/ajax/libs/lightgallery/1.10.0/js/lightgallery.min.js" defer></script><script src="https://cdnjs.loli.net/ajax/libs/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js" defer></script><script>window.addEventListener("load",()=>{"function"==typeof $.fn.lightGallery&&$(".article").lightGallery({selector:".gallery-item"}),"function"==typeof $.fn.justifiedGallery&&($(".justified-gallery > p > .gallery-item").length&&$(".justified-gallery > p > .gallery-item").unwrap(),$(".justified-gallery").justifiedGallery())})</script><script src="/js/main.js" defer></script><div class="searchbox"><div class="searchbox-container"><div class="searchbox-header"><div class="searchbox-input-container"><input class="searchbox-input" type="text" placeholder="Type something..."></div><a class="searchbox-close" href="javascript:;">×</a></div><div class="searchbox-body"></div></div></div><script src="/js/insight.js" defer></script><script>document.addEventListener("DOMContentLoaded",function(){loadInsight({contentUrl:"/content.json"},{hint:"Type something...",untitled:"(Untitled)",posts:"Posts",pages:"Pages",categories:"Categories",tags:"Tags"})})</script><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({pluginModelPath:"assets/",tagMode:!1,log:!1,model:{jsonPath:"/live2dw/assets/hijiki.model.json"},display:{position:"right",width:150,height:300},mobile:{show:!0},react:{opacity:.7},pluginJsPath:"lib/",pluginRootPath:"live2dw/"})</script></body></html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。