1 Star 0 Fork 0

LJQ/blog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
527244e6.html 41.48 KB
一键复制 编辑 原始数据 按行查看 历史
LJQ 提交于 2025-01-13 21:04 . Site updated: 2025-01-13 21:04:28
<!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:struct - 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="struct面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。Golang的Struct结构体(源于C语言,但又有别于C)的灵活性:go语言中并没有像C++,Java语言中这类的Class,它只含有像C语言中的结构体,用结构体和指针等特性,完成一个类的作用,很巧妙的使用了指针和结构体,不仅是go的面向对象,包括go语言中的map等操作都是借"><meta property="og:type" content="blog"><meta property="og:title" content="Go:struct"><meta property="og:url" content="https://www.defense.ink/527244e6.html"><meta property="og:site_name" content="Jack Liu Personal Site (ljq@GitHub).安全贯穿于软件开发各个环节."><meta property="og:description" content="struct面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。Golang的Struct结构体(源于C语言,但又有别于C)的灵活性:go语言中并没有像C++,Java语言中这类的Class,它只含有像C语言中的结构体,用结构体和指针等特性,完成一个类的作用,很巧妙的使用了指针和结构体,不仅是go的面向对象,包括go语言中的map等操作都是借"><meta property="og:locale" content="en_US"><meta property="og:image" content="https://source.unsplash.com/random/800x600/?tea"><meta property="article:published_time" content="2020-02-26T22:02:13.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="struct"><meta property="twitter:card" content="summary"><meta property="twitter:image" content="https://source.unsplash.com/random/800x600/?tea"><script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://www.defense.ink/527244e6.html"},"headline":"Go:struct","image":[],"datePublished":"2020-02-26T22:02:13.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":"struct面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。Golang的Struct结构体(源于C语言,但又有别于C)的灵活性:go语言中并没有像C++,Java语言中这类的Class,它只含有像C语言中的结构体,用结构体和指针等特性,完成一个类的作用,很巧妙的使用了指针和结构体,不仅是go的面向对象,包括go语言中的map等操作都是借"}</script><link rel="canonical" href="https://www.defense.ink/527244e6.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&amp;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/?tea" alt="Go:struct"></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&nbsp;<time datetime="2020-02-26T22:02:13.000Z" title="2/27/2020, 6:02:13 AM">2020-02-27</time></span><span class="level-item">Updated&nbsp;<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">4 minutes read (About 639 words)</span></div></div><h1 class="title is-3 is-size-4-mobile">Go:struct</h1><div class="content"><h3 id="struct"><a href="#struct" class="headerlink" title="struct"></a>struct</h3><h4 id="面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。"><a href="#面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。" class="headerlink" title="面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。"></a>面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。</h4><p>Golang的Struct结构体(源于C语言,但又有别于C)的灵活性:<br>go语言中并没有像C++,Java语言中这类的Class,它只含有像C语言中的结构体,用结构体和指针等特性,完成一个类的作用,很巧妙的使用了指针和结构体,不仅是go的面向对象,包括go语言中的map等操作都是借助了结构体。其实,说白了,C++、Java等面向对象的语言中,类的底层实现就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。很多人刚接触面向对象很不理解这些东西也应该缘于此。</p><span id="more"></span><p>或者说,面向对象的封装在某种意义上是以牺牲灵活特性的为代价的一种抽象简化。</p><p>所有高级语言(PHP、Java、Python、JavaScript等等…)的数组Array、字典map、Slice切片、Json等结构类型往往只是叫法不一样,多少都源于C系或者受到C系的Struct结构体思想的影响,在某些特定领域内,做了一些针对性的解决方案。</p><p>PHP就是c语言实现的一套高级“程序”语言,只不过是这套“程序化的语言”的规范和语法等机制可以用来快速做web领域的事情,通过解释器,转成底层语言完成代码的最终执行。</p><p>这也印证了很多答案往往追根溯源都在计算机数据结构基础里没有捷径可以走。</p><h4 id="golang-struct注意事项:"><a href="#golang-struct注意事项:" class="headerlink" title="golang struct注意事项:"></a>golang struct注意事项:</h4><p>对于struct类型来说,字段的先后顺序是非常关键的。如果两个struct类型包含了完全相同的字段,但是排列顺序不同或者进行了部分合并,那么这两个struct就是不同的类型!</p><p>如果struct字段是大写字母开头,那么该字段就是导出的(包外可见),这也符合Go语言的可见性规则。因此一个struct可以同时包含导出和未导出的变量。</p></div><div class="article-licensing box"><div class="licensing-title"><p>Go:struct</p><p><a href="https://www.defense.ink/527244e6.html">https://www.defense.ink/527244e6.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/struct/">struct</a></div><div class="sharethis-inline-share-buttons"></div><script src="https://platform-api.sharethis.com/js/sharethis.js#property=627845fc01dad800199bf3d4&amp;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="/8709d8d0.html"><i class="level-item fas fa-chevron-left"></i><span class="level-item">Go:switch</span></a></div><div class="level-end"><a class="article-nav-next level level-item link-muted" href="/b5903345.html"><span class="level-item">Go:关于Go语言:结构体(Struct)-方法(Method)-接收者(Receiver)类型的适用场景选择和命名约定(Go官方建议)</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="#struct"><span class="level-left"><span class="level-item">1</span><span class="level-item">struct</span></span></a><ul class="menu-list"><li><a class="level is-mobile" href="#面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。"><span class="level-left"><span class="level-item">1.1</span><span class="level-item">面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。</span></span></a></li><li><a class="level is-mobile" href="#golang-struct注意事项:"><span class="level-left"><span class="level-item">1.2</span><span class="level-item">golang struct注意事项:</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&amp;w=250&amp;t=n&amp;d=xb7wV_PHYtl9KaSZpQgP9CLUNrXlqm480vcarJmX2A0&amp;co=2d78ad&amp;cmo=3acc3a&amp;cmn=ff5353&amp;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>&copy; 2025 Jack Liu</span>  <span style="color:#e0e0e0">Powered by <a style="color:#e0e0e0" href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> &amp; <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&#039;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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML/CSS
1
https://gitee.com/jqe/blog.git
[email protected]:jqe/blog.git
jqe
blog
blog
master

搜索帮助