当前位置:首页 > 文章列表 > Golang > Go问答 > 对包含命名空间 xmlns:wcm 和 xmlns:xsi 的 XML 进行正确编组和解组

对包含命名空间 xmlns:wcm 和 xmlns:xsi 的 XML 进行正确编组和解组

来源:stackoverflow 2024-02-05 21:25:10 0浏览 收藏

今日不肯埋头,明日何以抬头!每日一句努力自己的话哈哈~哈喽,今天我将给大家带来一篇《对包含命名空间 xmlns:wcm 和 xmlns:xsi 的 XML 进行正确编组和解组》,主要内容是讲解等等,感兴趣的朋友可以收藏或者有更好的建议在评论提出,我都会认真看的!大家一起进步,一起学习!

问题内容

我正在尝试处理 windows autounattend.xml 文件的读取和写入,以便创建和修改它们。我无法正确封送和解封 xmlns:wcmxmlns:xsi 属性。



    
        
            
                en-us
            
            0409:00000409
            en-us
            en-us
            en-us
            en-us
        
        
            
                
                    0
                    true
                    
                        
                        
                            1
                            primary
                            300
                        
                        
                        
                            2
                            efi
                            100
                        
                        
                        
                            3
                            msr
                            128
                        
                        
                        
                            4
                            primary
                            true
                        
                    
                    
                        
                            1
                            1
                            
                            ntfs
                            de94bba4-06d1-4d40-a16a-bfd50179d6ac
                        
                        
                            2
                            2
                            
                            fat32
                        
                        
                            3
                            3
                        
                        
                            4
                            4
                            
                            c
                            ntfs
                        
                    
                
            
            
                
                    
                        0
                        4
                    
                    false
                
            
            
                
                    
                    never
                
                true
                admin
                
            
        
    
    
        
            false
        
    
    
        
            1
        
    
    
        
            0409:00000409
            en-us
            en-us
            en-us
            en-us
        
        
            true
        
        
            0
        
        
            -pc
            
        
    
    
        
            
                
                    
                    true</plaintext>
                </password>
                <enabled>true</enabled>
                <username>admin</username>
            </autologon>
            <oobe>
                <hideeulapage>true</hideeulapage>
                <hideoemregistrationscreen>true</hideoemregistrationscreen>
                <hideonlineaccountscreens>true</hideonlineaccountscreens>
                <hidewirelesssetupinoobe>true</hidewirelesssetupinoobe>
                <networklocation>home</networklocation>
                <skipuseroobe>true</skipuseroobe>
                <skipmachineoobe>true</skipmachineoobe>
                <protectyourpc>1</protectyourpc>
            </oobe>
            <useraccounts>
                <localaccounts>
                    <localaccount wcm:action="add">
                        <password>
                            <value></value>
                            <plaintext>true</plaintext>
                        </password>
                        <description></description>
                        <displayname>admin</displayname>
                        <group>administrators</group>
                        <name>admin</name>
                    </localaccount>
                </localaccounts>
            </useraccounts>
            <registeredorganization></registeredorganization>
            <registeredowner>admin</registeredowner>
            <disableautodaylighttimeset>false</disableautodaylighttimeset>
            <firstlogoncommands>
                <synchronouscommand wcm:action="add">
                    <description>control panel view</description>
                    <order>1</order>
                    <commandline>reg add "hkey_current_user\software\microsoft\windows\currentversion\explorer\controlpanel" /v startuppage /t reg_dword /d 1 /f</commandline>
                    <requiresuserinput>true</requiresuserinput>
                </synchronouscommand>
                <synchronouscommand wcm:action="add">
                    <order>2</order>
                    <description>control panel icon size</description>
                    <requiresuserinput>false</requiresuserinput>
                    <commandline>reg add "hkey_current_user\software\microsoft\windows\currentversion\explorer\controlpanel" /v allitemsiconview /t reg_dword /d 0 /f</commandline>
                </synchronouscommand>
                <synchronouscommand wcm:action="add">
                    <order>3</order>
                    <requiresuserinput>false</requiresuserinput>
                    <commandline>cmd /c wmic useraccount where name="admin" set passwordexpires=false</commandline>
                    <description>password never expires</description>
                </synchronouscommand>
            </firstlogoncommands>
            <timezone>central standard time</timezone>
        </component>
    </settings>
</unattend>
</pre>
<p>我尝试使用 <code>xml.name</code>、<code>xml.attr</code> 和字符串,但没有成功</p>
<pre class="brush:golang;toolbar:false;">
const (
    // A generic XML header suitable for use with the output of Marshal.
    Header = `<?xml version="1.0" encoding="UTF-8"?>` + "\n"
    WCM    = `http://schemas.microsoft.com/WMIConfig/2002/State`
    XSI    = `http://www.w3.org/2001/XMLSchema-instance`
)

type UserData struct {
    AcceptEula   bool   `xml:"AcceptEula"`
    FullName     string `xml:"FullName"`
    Organization string `xml:"Organization"`
    ProductKey   struct {
        Key        string `xml:"Key"`
        WillShowUI string `xml:"WillShowUI"`
    } `xml:"ProductKey"`
}

type OSImage struct {
    XMLName                     xml.Name `xml:"OSImage"`
    InstallToAvailablePartition bool     `xml:"InstallToAvailablePartition"`
    InstallToDiskID             uint32   `xml:"InstallTo>DiskID"`
    InstallToPatitionID         uint32   `xml:"InstallTo>ParitionID"`
}

type ImageInstall struct {
    XMLName xml.Name `xml:"ImageInstall"`
    OSImage OSImage  `xml:"OSImage"`
}

type CreatePartition struct {
    XMLName xml.Name `xml:"CreatePartition"`
    Order   uint32   `xml:"Order"`
    Type    string   `xml:"Type"`
    Size    uint64   `xml:"Size,omitempty"`
    Extend  bool     `xml:"Extend,omitempty"`
    Action  xml.Attr `xml:"action,attr"`
}
type ModifyPartition struct {
    XMLName     xml.Name `xml:"ModifyPartition"`
    Order       uint32   `xml:"Order"`
    PartitionID uint32   `xml:"PartitionID"`
    Label       string   `xml:"Label,omitempty"`
    Format      string   `xml:"Format,omitempty"`
    TypeID      string   `xml:"TypeID,omitempty"`
    Letter      string   `xml:"Letter,omitempty"`
    Action      xml.Attr `xml:"action,attr"`
}
type Disk struct {
    XMLName          xml.Name           `xml:"Disk"`
    Action           xml.Attr           `xml:"action,attr"`
    DiskID           uint32             `xml:"DiskID"`
    WillWipeDisk     bool               `xml:"WillWipeDisk"`
    CreatePartitions []*CreatePartition `xml:"CreatePartitions>."`
    ModifyPartitions []*ModifyPartition `xml:"ModifyPartitions>."`
}

type DiskConfiguration struct {
    XMLName xml.Name `xml:"DiskConfiguration"`
    Disks   []*Disk  `xml:"Disk"`
}

type SetupUILanguage struct {
    XMLName    xml.Name    `xml:"SetupUILanguage"`
    UILanguage *UILanguage `xml:"UILanguage"`
}

type UserLocale struct {
    XMLName xml.Name `xml:"UserLocale"`
    Value   string   `xml:",chardata"`
}

type InputLocale struct {
    XMLName xml.Name `xml:"InputLocale"`
    Value   string   `xml:",chardata"`
}

type SystemLocale struct {
    XMLName xml.Name `xml:"SystemLocale"`
    Value   string   `xml:",chardata"`
}

type UILanguage struct {
    XMLName xml.Name `xml:"UILanguage"`
    Value   string   `xml:",chardata"`
}

type UILanguageFallback struct {
    XMLName xml.Name `xml:"UILanguageFallback"`
    Value   string   `xml:",chardata"`
}

type EnableLUA struct {
    XMLName xml.Name `xml:"EnableLUA"`
    Value   bool     `xml:",chardata"`
}

type SkipRearm struct {
    XMLName xml.Name `xml:"SkipRearm"`
    Value   int32    `xml:",chardata"`
}

type SkipAutoActivation struct {
    XMLName xml.Name `xml:"SkipAutoActivation"`
    Value   bool     `xml:",chardata"`
}
type CEIPEnabled struct {
    XMLName xml.Name `xml:"CEIPEnabled"`
    Value   int32    `xml:",chardata"`
}
type ComputerName struct {
    XMLName xml.Name `xml:"ComputerName"`
    Value   string   `xml:",chardata"`
}
type ProductKey struct {
    XMLName xml.Name `xml:"ProductKey"`
    Value   string   `xml:",chardata"`
}

type Password struct {
    XMLName   xml.Name `xml:"Password"`
    Value     string   `xml:"Value"`
    PlainText bool     `xml:"PlainText"`
}

type AutoLogon struct {
    XMLName  xml.Name `xml:"AutoLogon"`
    Enabled  bool     `xml:"Enabled"`
    Username string   `xml:"Username"`
    Password Password `xml:"Password"`
}

type OOBE struct {
    XMLName                   xml.Name `xml:"OOBE"`
    HideEULAPage              bool     `xml:"HideEULAPage,omitempty"`
    HideOEMRegistrationScreen bool     `xml:"HideOEMRegistrationScreen,omitempty"`
    HideOnlineAccountScreens  bool     `xml:"HideOnlineAccountScreens,omitempty"`
    HideWirelessSetupInOOBE   bool     `xml:"HideWirelessSetupInOOBE,omitempty"`
    NetworkLocation           string   `xml:"NetworkLocation,omitempty"`
    SkipUserOOBE              bool     `xml:"SkipUserOOBE,omitempty"`
    SkipMachineOOBE           bool     `xml:"SkipMachineOOBE,omitempty"`
    ProtectYourPC             int32    `xml:"ProtectYourPC,omitempty"`
}

type LocalAccount struct {
    XMLName     xml.Name `xml:"LocalAccount"`
    Action      xml.Attr `xml:"action,attr"`
    Password    Password `xml:"Password"`
    Description string   `xml:"Description"`
    DisplayName string   `xml:"DisplayName"`
    Group       string   `xml:"Group"`
    Name        string   `xml:"Name"`
}

type LocalAccounts struct {
    XMLName      xml.Name
    LocalAccount []*LocalAccount `xml:"LocalAccount"`
}

type UserAccounts struct {
    XMLName       xml.Name      `xml:"UserAccounts"`
    LocalAccounts LocalAccounts `xml:"LocalAccounts"`
}

type RegisteredOrganization struct {
    XMLName xml.Name `xml:"RegisteredOrganization"`
    Value   string   `xml:",chardata"`
}
type RegisteredOwner struct {
    XMLName xml.Name `xml:"RegisteredOwner"`
    Value   string   `xml:",chardata"`
}
type DisableAutoDaylightTimeSet struct {
    XMLName xml.Name `xml:"DisableAutoDaylightTimeSet"`
    Value   bool     `xml:",chardata"`
}

type CommandLine struct {
    XMLName xml.Name `xml:"CommandLine"`
    Value   string   `xml:",innerxml"`
}

type SynchronousCommand struct {
    XMLName           xml.Name    `xml:"SynchronousCommand"`
    Order             uint32      `xml:"Order"`
    Description       string      `xml:"Description"`
    RequiresUserInput bool        `xml:"RequiresUserInput"`
    CommandLine       CommandLine `xml:"CommandLine"`
}

type FirstLogonCommands struct {
    XMLName            xml.Name              `xml:"FirstLogonCommands"`
    SynchronousCommand []*SynchronousCommand `xml:"SynchronousCommand"`
}
type TimeZone struct {
    XMLName xml.Name `xml:"TimeZone"`
    Value   string   `xml:",chardata"`
}

type Component struct {
    XMLName               xml.Name `xml:"component"`
    Name                  string   `xml:"name,attr"`
    ProcessorArchitecture string   `xml:"processorArchitecture,attr"`
    PublicKeyToken        string   `xml:"publicKeyToken,attr"`
    Language              string   `xml:"language,attr"`
    VersionScope          string   `xml:"versionScope,attr"`
    // optional compontents
    SetupUILanguage            *SetupUILanguage            `xml:"SetupUILanguage"`
    UserLocale                 *UserLocale                 `xml:"UserLocale"`
    InputLocale                *InputLocale                `xml:"InputLocale"`
    SystemLocale               *SystemLocale               `xml:"SystemLocale"`
    UILanguage                 *UILanguage                 `xml:"UILanguage"`
    UILanguageFallback         *UILanguageFallback         `xml:"UILanguageFallback"`
    DiskConfiguration          *DiskConfiguration          `xml:"DiskConfiguration,omitempty"`
    ImageInstall               *ImageInstall               `xml:"ImageInstall,omitempty"`
    UserData                   *UserData                   `xml:"UserData,omitempty"`
    EnableLUA                  *EnableLUA                  `xml:"EnableLUA,omitempty"`
    SkipRearm                  *SkipRearm                  `xml:"SkipRearm,omitempty"`
    ProductKey                 *ProductKey                 `xml:"ProductKey,omitempty"`
    ComputerName               *ComputerName               `xml:"ComputerName,omitempty"`
    SkipAutoActivation         *SkipAutoActivation         `xml:"SkipAutoActivation,omitempty"`
    CEIPEnabled                *CEIPEnabled                `xml:"CEIPEnabled,omitempty"`
    AutoLogon                  *AutoLogon                  `xml:"AutoLogon,omitempty"`
    OOBE                       *OOBE                       `xml:"OOBE,omitempty"`
    UserAccounts               *UserAccounts               `xml:"UserAccounts"`
    RegisteredOrganization     *RegisteredOrganization     `xml:"RegisteredOrganization,omitempty"`
    RegisteredOwner            *RegisteredOwner            `xml:"RegisteredOwner,omitempty"`
    DisableAutoDaylightTimeSet *DisableAutoDaylightTimeSet `xml:"DisableAutoDaylightTimeSet,omitempty"`
    FirstLogonCommands         *FirstLogonCommands         `xml:"FirstLogonCommands,omitempty"`
    TimeZone                   *TimeZone                   `xml:"TimeZone,omitempty"`
}

type Settings struct {
    XMLName    xml.Name     `xml:"settings"`
    Pass       string       `xml:"pass,attr"`
    Components []*Component `xml:"component"`
}

type Unattend struct {
    XMLName  xml.Name    `xml:"unattend"`
    XMLNS    xml.Attr    `xml:"xmlns,attr"`
    Settings []*Settings `xml:"settings"`
}


</pre><br><h2 class="daan">正确答案</h2><br><p><code>xmlns:wcm</code> 和 <code>xmlns:xsi</code> 并不是真正的属性,它们是经过特殊处理的。您的 xml 既没有 <code>wcm</code> 和 <code>xsi</code> 架构中的元素也没有属性,因此它们将被删除。为什么你的代码中需要它们?</p>
<p>如果您确实需要它们,您可以将以下字段添加到 <code>component</code> 结构中:</p>
<pre class="brush:php;toolbar:false;">attr                  []xml.attr `xml:",any,attr"`</pre>
<p><a target='_blank' href='https://www.17golang.com/gourl/?redirect=MDAwMDAwMDAwML57hpSHp6VpkrqbYLx2eayza4KafaOkbLS3zqSBrJvPsa5_0Ia6sWuR4Juaq6t9nq5roGCUgXuytMyerpd5q9OwoZXahNC2pZzPaZzEn36qv4CkpYqycmzHut2iiols2b2Me96Zqqqsh8-FY7SGoGS_kaBggJB_ssiVn6KViX2VvouC0IXNpmmRvZOcr5xynsdrbWCJkKWtxrqbpoCFrtGxnnrQhc6yoZrUm5yvnX6cyYGKqXqNgrGxppakgZ2E0bGec7qa0JWhm9R-n7uJp6Cyo3qpipCHrsjQuLJ-hoDcyHuZ0IHcsaOB336bvIaBaLJ9ipx_jYujss2ra42fhN6ziJiZh6q5s4aYfaqvZIVlvrOSmn-KdnU'><code>xml.Unmarshal</code> documentation says</a>:</p>

<p>如果 xml 元素具有先前规则未处理的属性,并且结构体具有包含“,any,attr”的关联标记的字段,则 unmarshal 会在第一个此类字段中记录该属性值。</p>

<p>这里是一个例子:<a target='_blank' href='https://www.17golang.com/gourl/?redirect=MDAwMDAwMDAwML57hpSHp6VpkrqbYLx2eayza4KafaOkbLS3zqSBrJvPsa5_0Ia6sWuR4Juaq6t9nq5roGCUgXuytMyero5kb9q-e4eWhJamrJG-m6bFdWlkt2mKn36Of22yutqZiquEz62tfs6Sqrlph6pxYLyGm2S_fYGofmuDorLN0WyDhp_Rsa6VzoXdsqWGvX1iu6ybcQ'>https://go.dev/play/p/tGDh5Ay1kZW</a></p>
<pre class="brush:php;toolbar:false;">func main() {
    var u unattend
    err := xml.unmarshal([]byte(document), &u)
    if err != nil {
        log.fatal(err)
    }
    for _, a := range u.settings[0].components[0].attr {
        fmt.printf("unmatched attributes: %s:%s = %s\n", a.name.space, a.name.local, a.value)
    }
}</pre>
<p>输出:</p>
<pre class="brush:php;toolbar:false;">unmatched attributes: xmlns:wcm = http://schemas.microsoft.com/wmiconfig/2002/state
unmatched attributes: xmlns:xsi = http://www.w3.org/2001/xmlschema-instance</pre>
<p>注意 1。此解决方案的缺点是:它仅处理 <code><component/></code> 中的额外属性。但 <code>xmlns:xxx</code> 属性可以出现在任何元素中。一般情况下,您应该在数据模型的所有结构中添加 <code>attr</code> 数组。</p>
<p>注2.属性<code>xmlns:wcm</code>和<code>xmlns:xsi</code>不包含任何业务逻辑。他们没有提供有关设置和组件的信息。你真的需要它们吗?</p>
<p>注释 3. 绝对不需要将这些属性命名为 <code>xmlns:wcm</code> 和 <code>xmlns:xsi</code>。这只是一种常见的做法。 xml 文档可以将它们命名为 <code>xmlns:foo</code> 和 <code>xmlns:bar</code> - 这是完全有效的。即使值 <code>"http://schemas.microsoft.com/wmiconfig/2002/state"</code> 和 <code>"http://www.w3.org/2001/xmlschema-instance"</code> 也没有任何意义。它们可以是任何字符串,唯一的要求是匹配 <a target='_blank' href='https://www.17golang.com/gourl/?redirect=MDAwMDAwMDAwML57hpSHp6VpkrqbYLx2eayza4KafaOkbLS3zqSBrJvPsa5_0Ia6sWuR4Juaq6t9nq5roGCUgXuytMyerphlm5iwonvRkdyVpZKtnGDEZXmpx2yCnnxsg6W-3J-xjp-E37OImJaE0bZtnKl9mqurfZ6_gI1gf316aL-30WiOdoDdsmZ7zoXNz22Hupicr6yUnrKzhpx-kIZqvt3RdQ'>URI format</a>。 <code>urn:microsoft:wmi-config:2002:state</code> 与 <code>http://schemas.microsoft.com/wmiconfig/2002/state</code> 一样有效</p>
<p>解析 <code>component</code> 中的这些属性非常具体,对于在其他元素中或使用其他后缀或值声明这些属性的其他有效 xml 文档可能会失败。</p>
<p><strong>更新</strong></p>
<p>编组工作未按预期进行。 <code>xml.marshal</code> 专门处理 <code>xmlns</code> 命名空间,并将 <code>attr</code> 的 <code>xmlns:wcm</code> 和 <code>xmlns:xsi</code> 转换为命名空间 <code>_xmlns</code></p>
<pre class="brush:xml;toolbar:false;"><component name="microsoft-windows-security-spp" processorarchitecture="amd64" publickeytoken="31bf3856ad364e35" language="neutral" versionscope="nonsxs" xmlns:_xmlns="xmlns" _xmlns:wcm="http://schemas.microsoft.com/wmiconfig/2002/state" _xmlns:xsi="http://www.w3.org/2001/xmlschema-instance">
...
</component>
</pre>
<p>解决方法是对属性使用特殊类型:</p>
<pre class="brush:php;toolbar:false;">type xmlnsattr struct {
    name  xml.name
    value string
}

func (a xmlnsattr) label() string {
    if a.name.space == "" {
        return a.name.local
    }
    if a.name.local == "" {
        return a.name.space
    }
    return a.name.space + ":" + a.name.local
}

func (a *xmlnsattr) unmarshalxmlattr(attr xml.attr) error {
    a.name = attr.name
    a.value = attr.value
    return nil
}

func (a xmlnsattr) marshalxmlattr(name xml.name) (xml.attr, error) {
    return xml.attr{
        name: xml.name{
            space: "",
            local: a.label(),
        },
        value: a.value,
    }, nil
}</pre>
<p>此类型通过构造一个属性并将命名空间嵌入到本地名称中来实现这一点。领域</p>
<pre class="brush:golang;toolbar:false;">    attr                  []xml.attr `xml:",any,attr"`
</pre>
<p>正确解码/编码 <code>xmlns:xxx</code> 属性</p>
<p>示例:<a target='_blank' href='https://www.17golang.com/gourl/?redirect=MDAwMDAwMDAwML57hpSHp6VpkrqbYLx2eayza4KafaOkbLS3zqSBrJvPsa5_0Ia6sWuR4Juaq6t9nq5roGCUgXuytMyero5kb9q-e4eWhJamrJG-m6bFdWmLt4BxnYWkj6uzupulgYWEz62tfs6Sqrlph6pxYLyGm2S_fYGofmuDorLN0WyDhp_Rsa6VzoXdsqWGvX1iu6ybcQ'>https://go.dev/play/p/VDofREl5nf1</a></p>
<p>输出:</p>
<pre class="brush:php;toolbar:false;">Unmatched attributes: xmlns:wcm = http://schemas.microsoft.com/WMIConfig/2002/State
Unmatched attributes: xmlns:xsi = http://www.w3.org/2001/XMLSchema-instance
<unattend>
  <settings pass="windowsPE">
    <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        ...
    </component>
    ...
  </settings>
</unattend></pre><p>以上就是《对包含命名空间 xmlns:wcm 和 xmlns:xsi 的 XML 进行正确编组和解组》的详细内容,更多关于的资料请关注golang学习网公众号!</p>                </div>
                <div class="labsList">
                                    </div>
                                <div class="claration">
                    <div class="clarationTit">版本声明</div>本文转载于:stackoverflow 如有侵犯,请联系<a href="javascript:;" class="aRed">study_golang@163.com</a>删除
                </div>
                                <div class="cateBox">
                                        <div class="cateItem">
                        <a href="/article/93948.html" title="时间范围内数组元素的标准化方法" class="img_box">
                            <img src="/uploads/940/0f58cfee408459075ddb60ed0b143658.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="时间范围内数组元素的标准化方法">时间范围内数组元素的标准化方法                        </a>
                        <dl>
                            <dt class="lineOverflow"><a href="/article/93948.html"  title="时间范围内数组元素的标准化方法" class="aBlack">上一篇<i></i></a></dt>
                            <dd class="lineTwoOverflow">时间范围内数组元素的标准化方法</dd>
                        </dl>
                    </div>
                                        <div class="cateItem">
                        <a href="/article/93950.html"  title="为什么在 Goland (IDEA) 中 Go 源代码显示为灰色?如何恢复正常显示?" class="img_box">
                            <img src="/uploads/940/6ca6acb73559e41f084bf26890eb913f.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="为什么在 Goland (IDEA) 中 Go 源代码显示为灰色?如何恢复正常显示?">
                        </a>
                        <dl>
                            <dt class="lineOverflow"><a href="/article/93950.html"  class="aBlack" title="为什么在 Goland (IDEA) 中 Go 源代码显示为灰色?如何恢复正常显示?">下一篇<i></i></a></dt>
                            <dd class="lineTwoOverflow">为什么在 Goland (IDEA) 中 Go 源代码显示为灰色?如何恢复正常显示?</dd>
                        </dl>
                    </div>
                                    </div>
            </div>
        </div>
                <div class="leftContBox pt0">
            <div class="pdl20">
                <div class="contTit">
                    <a href="/articlelist.html" class="more" title="查看更多">查看更多<i class="iconfont">&#xe603;</i></a>
                    <div class="tit">最新文章</div>
                </div>
            </div>
            <ul class="newArticleList">
                                <li>
                    <div class="contBox">
                        <a href="/article/620243.html" class="img_box" title="Go Mutex 和 channel 哪个性能更好:共享变量、任务交接和等待链怎么选">
                            <img src="/uploads/20260709/1783578438-channel-queue-chain.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go Mutex 和 channel 哪个性能更好:共享变量、任务交接和等待链怎么选">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/19_new_0_1.html" class="aLightGray" title="并发">并发</a>&nbsp;·
                                                                          <a href="/articletag/136_new_0_1.html" class="aLightGray" title="channel">channel</a>&nbsp;·
                                                                          <a href="/articletag/199_new_0_1.html" class="aLightGray" title="Mutex">Mutex</a>&nbsp;·
                                                                          <a href="/articletag/729_new_0_1.html" class="aLightGray" title="性能优化">性能优化</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                          <a href="/articletag/40209_new_0_1.html" class="aLightGray" title="benchmark">benchmark</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="Goroutine">Goroutine</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="channel">channel</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Mutex">Mutex</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="并发性能">并发性能</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="锁等待">锁等待</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="benchmark">benchmark</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620243.html" class="aBlack" target="_blank" title="Go Mutex 和 channel 哪个性能更好:共享变量、任务交接和等待链怎么选">Go Mutex 和 channel 哪个性能更好:共享变量、任务交接和等待链怎么选</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>268浏览</span>
                                <span class="collectBtn user_collection" data-id="620243" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620238.html" class="img_box" title="Go map 并发读写为什么会 panic:加锁、单协程和 sync.Map 怎么选">
                            <img src="/uploads/20260709/1783574529-go-map-panic-timeline.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go map 并发读写为什么会 panic:加锁、单协程和 sync.Map 怎么选">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/19_new_0_1.html" class="aLightGray" title="并发">并发</a>&nbsp;·
                                                                          <a href="/articletag/56_new_0_1.html" class="aLightGray" title="map">map</a>&nbsp;·
                                                                          <a href="/articletag/198_new_0_1.html" class="aLightGray" title="RWMutex">RWMutex</a>&nbsp;·
                                                                          <a href="/articletag/1550_new_0_1.html" class="aLightGray" title="sync.Map">sync.Map</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="数据竞争">数据竞争</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="RWMutex">RWMutex</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="sync.Map">sync.Map</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="map并发读写">map并发读写</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="concurrent map read and map write">concurrent map read and map write</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620238.html" class="aBlack" target="_blank" title="Go map 并发读写为什么会 panic:加锁、单协程和 sync.Map 怎么选">Go map 并发读写为什么会 panic:加锁、单协程和 sync.Map 怎么选</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>291浏览</span>
                                <span class="collectBtn user_collection" data-id="620238" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620237.html" class="img_box" title="Go channel 关闭后还能读吗:读写规则、退出流程和常见坑">
                            <img src="/uploads/20260709/1783573805-go-channel-close-read-rule.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go channel 关闭后还能读吗:读写规则、退出流程和常见坑">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/19_new_0_1.html" class="aLightGray" title="并发">并发</a>&nbsp;·
                                                                          <a href="/articletag/136_new_0_1.html" class="aLightGray" title="channel">channel</a>&nbsp;·
                                                                          <a href="/articletag/339_new_0_1.html" class="aLightGray" title="range">range</a>&nbsp;·
                                                                          <a href="/articletag/538_new_0_1.html" class="aLightGray" title="Close">Close</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="并发退出">并发退出</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Channel关闭">Channel关闭</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="close channel">close channel</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="range退出">range退出</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="发送方关闭">发送方关闭</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620237.html" class="aBlack" target="_blank" title="Go channel 关闭后还能读吗:读写规则、退出流程和常见坑">Go channel 关闭后还能读吗:读写规则、退出流程和常见坑</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>427浏览</span>
                                <span class="collectBtn user_collection" data-id="620237" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620235.html" class="img_box" title="Go HTTP 请求取消后任务会自动停吗:context 传递、超时和资源释放">
                            <img src="/uploads/20260709/1783572296-go-http-context-release.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go HTTP 请求取消后任务会自动停吗:context 传递、超时和资源释放">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/431_new_0_1.html" class="aLightGray" title="goroutine">goroutine</a>&nbsp;·
                                                                          <a href="/articletag/540_new_0_1.html" class="aLightGray" title="HTTP">HTTP</a>&nbsp;·
                                                                          <a href="/articletag/778_new_0_1.html" class="aLightGray" title="Context">Context</a>&nbsp;·
                                                                          <a href="/articletag/898_new_0_1.html" class="aLightGray" title="超时控制">超时控制</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="WithTimeout">WithTimeout</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="context取消">context取消</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="QueryContext">QueryContext</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="HTTP请求取消">HTTP请求取消</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="goroutine退出">goroutine退出</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620235.html" class="aBlack" target="_blank" title="Go HTTP 请求取消后任务会自动停吗:context 传递、超时和资源释放">Go HTTP 请求取消后任务会自动停吗:context 传递、超时和资源释放</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>120浏览</span>
                                <span class="collectBtn user_collection" data-id="620235" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620233.html" class="img_box" title="Go goroutine 泄漏怎么排查:pprof 快照、止血和回退手册">
                            <img src="/uploads/20260709/1783570773-go-goroutine-leak-judge.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go goroutine 泄漏怎么排查:pprof 快照、止血和回退手册">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/431_new_0_1.html" class="aLightGray" title="goroutine">goroutine</a>&nbsp;·
                                                                          <a href="/articletag/2250_new_0_1.html" class="aLightGray" title="pprof">pprof</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                          <a href="/articletag/39820_new_0_1.html" class="aLightGray" title="线上排查">线上排查</a>&nbsp;·
                                                                          <a href="/articletag/40203_new_0_1.html" class="aLightGray" title="性能调优">性能调优</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="pprof">pprof</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="goroutine泄漏">goroutine泄漏</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="服务告警">服务告警</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="context取消">context取消</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go线上排查">Go线上排查</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620233.html" class="aBlack" target="_blank" title="Go goroutine 泄漏怎么排查:pprof 快照、止血和回退手册">Go goroutine 泄漏怎么排查:pprof 快照、止血和回退手册</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>374浏览</span>
                                <span class="collectBtn user_collection" data-id="620233" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620225.html" class="img_box" title="Go context.WithTimeout 会自动停掉 goroutine 吗:取消信号和阻塞点怎么处理">
                            <img src="/uploads/20260709/1783564465-context-done-signal.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go context.WithTimeout 会自动停掉 goroutine 吗:取消信号和阻塞点怎么处理">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/431_new_0_1.html" class="aLightGray" title="goroutine">goroutine</a>&nbsp;·
                                                                          <a href="/articletag/778_new_0_1.html" class="aLightGray" title="Context">Context</a>&nbsp;·
                                                                          <a href="/articletag/898_new_0_1.html" class="aLightGray" title="超时控制">超时控制</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                          <a href="/articletag/40189_new_0_1.html" class="aLightGray" title="协程泄漏">协程泄漏</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="Go">Go</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Goroutine">Goroutine</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="超时控制">超时控制</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="context.WithTimeout">context.WithTimeout</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="取消信号">取消信号</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="协程泄漏">协程泄漏</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="ctx.Done">ctx.Done</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620225.html" class="aBlack" target="_blank" title="Go context.WithTimeout 会自动停掉 goroutine 吗:取消信号和阻塞点怎么处理">Go context.WithTimeout 会自动停掉 goroutine 吗:取消信号和阻塞点怎么处理</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>147浏览</span>
                                <span class="collectBtn user_collection" data-id="620225" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620222.html" class="img_box" title="Go 1.22 后 for range 闭包还要写 v := v 吗:循环变量迁移检查">
                            <img src="/uploads/20260709/1783562097-loopvar-migration-check.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go 1.22 后 for range 闭包还要写 v := v 吗:循环变量迁移检查">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/124_new_0_1.html" class="aLightGray" title="闭包">闭包</a>&nbsp;·
                                                                          <a href="/articletag/594_new_0_1.html" class="aLightGray" title="go">go</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                          <a href="/articletag/39850_new_0_1.html" class="aLightGray" title="循环变量">循环变量</a>&nbsp;·
                                                                          <a href="/articletag/39851_new_0_1.html" class="aLightGray" title="Go1.22">Go1.22</a>&nbsp;·
                                                                          <a href="/articletag/40076_new_0_1.html" class="aLightGray" title="代码迁移">代码迁移</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="闭包">闭包</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="循环变量">循环变量</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="go vet">go vet</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go 1.22">Go 1.22</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="for range">for range</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="loopclosure">loopclosure</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620222.html" class="aBlack" target="_blank" title="Go 1.22 后 for range 闭包还要写 v := v 吗:循环变量迁移检查">Go 1.22 后 for range 闭包还要写 v := v 吗:循环变量迁移检查</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>356浏览</span>
                                <span class="collectBtn user_collection" data-id="620222" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620215.html" class="img_box" title="Go internal 包边界怎么定:哪些代码该藏起来,哪些应该开放复用">
                            <img src="/uploads/20260709/1783532384-go-internal-import-boundary.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go internal 包边界怎么定:哪些代码该藏起来,哪些应该开放复用">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/254_new_0_1.html" class="aLightGray" title="单元测试">单元测试</a>&nbsp;·
                                                                          <a href="/articletag/748_new_0_1.html" class="aLightGray" title="架构设计">架构设计</a>&nbsp;·
                                                                          <a href="/articletag/13516_new_0_1.html" class="aLightGray" title="internal">internal</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                          <a href="/articletag/40176_new_0_1.html" class="aLightGray" title="项目结构">项目结构</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="测试替身">测试替身</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="internal包">internal包</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go项目结构">Go项目结构</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="包边界">包边界</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="依赖边界">依赖边界</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620215.html" class="aBlack" target="_blank" title="Go internal 包边界怎么定:哪些代码该藏起来,哪些应该开放复用">Go internal 包边界怎么定:哪些代码该藏起来,哪些应该开放复用</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>127浏览</span>
                                <span class="collectBtn user_collection" data-id="620215" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620214.html" class="img_box" title="Go 值接收者和指针接收者怎么选:为什么接口实现会不一样">
                            <img src="/uploads/20260708/1783517228-go-receiver-choice-rule.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go 值接收者和指针接收者怎么选:为什么接口实现会不一样">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/21_new_0_1.html" class="aLightGray" title="接口">接口</a>&nbsp;·
                                                                          <a href="/articletag/92_new_0_1.html" class="aLightGray" title="值接收者">值接收者</a>&nbsp;·
                                                                          <a href="/articletag/279_new_0_1.html" class="aLightGray" title="方法集">方法集</a>&nbsp;·
                                                                          <a href="/articletag/399_new_0_1.html" class="aLightGray" title="指针接收者">指针接收者</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="接口实现">接口实现</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="指针接收者">指针接收者</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="值接收者">值接收者</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="方法集">方法集</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go接收者">Go接收者</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620214.html" class="aBlack" target="_blank" title="Go 值接收者和指针接收者怎么选:为什么接口实现会不一样">Go 值接收者和指针接收者怎么选:为什么接口实现会不一样</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>449浏览</span>
                                <span class="collectBtn user_collection" data-id="620214" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620211.html" class="img_box" title="Go sync.Pool 为什么会串数据:Reset 和 Put 的顺序怎么定">
                            <img src="/uploads/20260708/1783501082-sync-pool-dirty-state.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go sync.Pool 为什么会串数据:Reset 和 Put 的顺序怎么定">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;4天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/1743_new_0_1.html" class="aLightGray" title="sync.Pool">sync.Pool</a>&nbsp;·
                                                                          <a href="/articletag/16559_new_0_1.html" class="aLightGray" title="reset">reset</a>&nbsp;·
                                                                          <a href="/articletag/39696_new_0_1.html" class="aLightGray" title="对象复用">对象复用</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                          <a href="/articletag/39820_new_0_1.html" class="aLightGray" title="线上排查">线上排查</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="Go sync.Pool">Go sync.Pool</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="sync.Pool串数据">sync.Pool串数据</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Reset清理">Reset清理</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="对象池复用">对象池复用</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620211.html" class="aBlack" target="_blank" title="Go sync.Pool 为什么会串数据:Reset 和 Put 的顺序怎么定">Go sync.Pool 为什么会串数据:Reset 和 Put 的顺序怎么定</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>342浏览</span>
                                <span class="collectBtn user_collection" data-id="620211" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620201.html" class="img_box" title="Go io.Reader 为什么 EOF 前还要先处理 n:读取循环别丢最后一段">
                            <img src="/uploads/20260708/1783491952-reader-eof-before-after.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go io.Reader 为什么 EOF 前还要先处理 n:读取循环别丢最后一段">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;5天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/172_new_0_1.html" class="aLightGray" title="标准库">标准库</a>&nbsp;·
                                                                          <a href="/articletag/841_new_0_1.html" class="aLightGray" title="文件读取">文件读取</a>&nbsp;·
                                                                          <a href="/articletag/1432_new_0_1.html" class="aLightGray" title="io.Reader">io.Reader</a>&nbsp;·
                                                                          <a href="/articletag/39775_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>&nbsp;·
                                                                          <a href="/articletag/40162_new_0_1.html" class="aLightGray" title="io.EOF">io.EOF</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="Go">Go</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="read">read</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="io.Reader">io.Reader</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="io.EOF">io.EOF</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="Go问答">Go问答</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="n err">n err</a>
                                                                                             <a href="javascript:;" class="aLightGray" title="读取循环">读取循环</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620201.html" class="aBlack" target="_blank" title="Go io.Reader 为什么 EOF 前还要先处理 n:读取循环别丢最后一段">Go io.Reader 为什么 EOF 前还要先处理 n:读取循环别丢最后一段</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>486浏览</span>
                                <span class="collectBtn user_collection" data-id="620201" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                                <li>
                    <div class="contBox">
                        <a href="/article/620197.html" class="img_box" title="Go time.After 写在循环里会泄漏吗:定时器堆积、Stop 和 NewTimer 复用怎么判断">
                            <img src="/uploads/20260708/1783489095-go-newtimer-reuse.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Go time.After 写在循环里会泄漏吗:定时器堆积、Stop 和 NewTimer 复用怎么判断">
                        </a>
                        <dl>
                            <dd class="cont1">
                  <span>
                                                                <a href="/articlelist/25_new_0_1.html" class="aLightGray" title="Golang">Golang</a>&nbsp;·
                                                                            <a href="/articlelist/45_new_0_1.html" class="aLightGray" title="Go问答">Go问答</a>
                                                     &nbsp;&nbsp;|&nbsp;&nbsp;5天前&nbsp;&nbsp;|&nbsp;&nbsp;

                                                                        <a href="/articletag/40157_new_0_1.html" class="aLightGray" title="[]">[]</a>&nbsp;·
                                                                                   <a href="javascript:;" class="aLightGray" title="[]">[]</a>
                                                              </span>
                            </dd>
                            <dt class="lineOverflow">
                                <a href="/article/620197.html" class="aBlack" target="_blank" title="Go time.After 写在循环里会泄漏吗:定时器堆积、Stop 和 NewTimer 复用怎么判断">Go time.After 写在循环里会泄漏吗:定时器堆积、Stop 和 NewTimer 复用怎么判断</a>
                            </dt>
                            <dd class="cont2">
                                <span><i class="view"></i>181浏览</span>
                                <span class="collectBtn user_collection" data-id="620197" data-type="article" title="收藏"><i class="collect"></i>收藏</span>
                            </dd>
                        </dl>
                    </div>
                </li>
                            </ul>
        </div>
    </div>
    <div class="mainRight">
        <!-- 右侧广告位banner -->
        <div class="rightContBox" style="margin-top: 0px;">
            <div class="rightTit">
                <a href="/courselist.html" class="more" title="查看更多">查看更多<i class="iconfont">&#xe603;</i></a>
                <div class="tit lineOverflow">课程推荐</div>
            </div>
            <ul class="lessonRecomRList">
                                <li>
                    <a href="/course/9.html" class="img_box" target="_blank" title="前端进阶之JavaScript设计模式">
                        <img src="/uploads/20221222/52fd0f23a454c71029c2c72d206ed815.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="前端进阶之JavaScript设计模式">
                                            </a>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/course/9.html" target="_blank" class="aBlack" title="前端进阶之JavaScript设计模式">前端进阶之JavaScript设计模式</a></dt>
                        <dd class="cont1 lineTwoOverflow">
                            设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。                        </dd>
                        <dd class="cont2">543次学习</dd>
                    </dl>
                </li>
                                <li>
                    <a href="/course/2.html" class="img_box" target="_blank" title="GO语言核心编程课程">
                        <img src="/uploads/20221221/634ad7404159bfefc6a54a564d437b5f.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="GO语言核心编程课程">
                                            </a>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/course/2.html" target="_blank" class="aBlack" title="GO语言核心编程课程">GO语言核心编程课程</a></dt>
                        <dd class="cont1 lineTwoOverflow">
                            本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。                        </dd>
                        <dd class="cont2">516次学习</dd>
                    </dl>
                </li>
                                <li>
                    <a href="/course/74.html" class="img_box" target="_blank" title="简单聊聊mysql8与网络通信">
                        <img src="/uploads/20240103/bad35fe14edbd214bee16f88343ac57c.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="简单聊聊mysql8与网络通信">
                                            </a>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/course/74.html" target="_blank" class="aBlack" title="简单聊聊mysql8与网络通信">简单聊聊mysql8与网络通信</a></dt>
                        <dd class="cont1 lineTwoOverflow">
                            如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让                        </dd>
                        <dd class="cont2">500次学习</dd>
                    </dl>
                </li>
                                <li>
                    <a href="/course/57.html" class="img_box" target="_blank" title="JavaScript正则表达式基础与实战">
                        <img src="/uploads/20221226/bbe4083bb3cb0dd135fb02c31c3785fb.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="JavaScript正则表达式基础与实战">
                                            </a>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/course/57.html" target="_blank" class="aBlack" title="JavaScript正则表达式基础与实战">JavaScript正则表达式基础与实战</a></dt>
                        <dd class="cont1 lineTwoOverflow">
                            在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。                        </dd>
                        <dd class="cont2">487次学习</dd>
                    </dl>
                </li>
                                <li>
                    <a href="/course/28.html" class="img_box" target="_blank" title="从零制作响应式网站—Grid布局">
                        <img src="/uploads/20221223/ac110f88206daeab6c0cf38ebf5fe9ed.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="从零制作响应式网站—Grid布局">
                                            </a>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/course/28.html" target="_blank" class="aBlack" title="从零制作响应式网站—Grid布局">从零制作响应式网站—Grid布局</a></dt>
                        <dd class="cont1 lineTwoOverflow">
                            本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。                        </dd>
                        <dd class="cont2">485次学习</dd>
                    </dl>
                </li>
                            </ul>
        </div>
        <div class="rightContBox">
        <div class="rightTit">
            <a href="/ai.html" class="more" title="查看更多">查看更多<i class="iconfont">&#xe603;</i></a>
            <div class="tit lineOverflow">AI推荐</div>
        </div>
        <ul class="lessonRecomRList">
                        <li>
                <a href="/ai/13109.html"  target="_blank" title="ljg-skills - "Prompt之神"李继刚开源的 AI 技能集" class="img_box">
                    <img src="/uploads/ai/20260616/ljg-skills-icon-8bbe1468e5.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="ljg-skills - "Prompt之神"李继刚开源的 AI 技能集" style="object-fit:cover;width:100%;height:100%;">
                </a>
                <dl>
                    <dt class="lineTwoOverflow"><a href="/ai/13109.html" class="aBlack" target="_blank" title="ljg-skills">ljg-skills</a></dt>
                    <dd class="cont1 lineTwoOverflow">
                        ljg-skills 是李继刚开源的 AI 技能与提示词集合,面向大模型使用者整理了一批可复用的 prompt、角色设定和任务技能模板,适合用于学习提示词设计、搭建个人 AI 工作流和沉淀团队常用智能体能力。                    </dd>
                    <dd class="cont2">4464次使用</dd>
                </dl>
            </li>
                        <li>
                <a href="/ai/13108.html"  target="_blank" title="MELO音乐 - AI 音乐生成平台,支持多模态创作能力" class="img_box">
                    <img src="/uploads/ai/20260616/melo-icon-10bf590762.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="MELO音乐 - AI 音乐生成平台,支持多模态创作能力" style="object-fit:cover;width:100%;height:100%;">
                </a>
                <dl>
                    <dt class="lineTwoOverflow"><a href="/ai/13108.html" class="aBlack" target="_blank" title="MELO音乐">MELO音乐</a></dt>
                    <dd class="cont1 lineTwoOverflow">
                        MELO音乐是一站式AI视频与音乐制作助手,对标suno, udio的高品质体验。提供伴奏生成、原创写词、无损导出、哼唱识曲、混音变声等全套音频与短视频编辑工具。无论是流行Kpop、电音说唱、民谣古风、摇滚儿歌还是商用轻音乐,MELO为你免费谱曲,轻松做同款!                    </dd>
                    <dd class="cont2">4110次使用</dd>
                </dl>
            </li>
                        <li>
                <a href="/ai/13107.html"  target="_blank" title="UniScribe - AI 免费在线音视频转文字平台" class="img_box">
                    <img src="/uploads/ai/20260616/uniscribe-icon-3c88366a15.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="UniScribe - AI 免费在线音视频转文字平台" style="object-fit:cover;width:100%;height:100%;">
                </a>
                <dl>
                    <dt class="lineTwoOverflow"><a href="/ai/13107.html" class="aBlack" target="_blank" title="UniScribe">UniScribe</a></dt>
                    <dd class="cont1 lineTwoOverflow">
                        UniScribe 是一款 AI 音视频转文字与内容整理工具,支持上传音频、视频文件或粘贴 YouTube 链接,自动生成转写文本、摘要、思维导图和关键问题,并支持多格式导出,适合会议记录、课程学习、访谈整理和内容创作复盘。                    </dd>
                    <dd class="cont2">4098次使用</dd>
                </dl>
            </li>
                        <li>
                <a href="/ai/13106.html"  target="_blank" title="剧云 - 免费 AI 智能中文剧本创作平台" class="img_box">
                    <img src="/uploads/ai/20260615/d36c7176-icon-2b0cd581ce.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="剧云 - 免费 AI 智能中文剧本创作平台" style="object-fit:cover;width:100%;height:100%;">
                </a>
                <dl>
                    <dt class="lineTwoOverflow"><a href="/ai/13106.html" class="aBlack" target="_blank" title="剧云">剧云</a></dt>
                    <dd class="cont1 lineTwoOverflow">
                        剧云是专业中文剧本创作平台,安全稳定运行十余年,集成AI编剧、剧本医生审核、人物小传、剧情关系图、大纲编写、多人协作、Word导入导出、版权管控功能,数据安全防护,轻松高效创作剧本。                    </dd>
                    <dd class="cont2">4283次使用</dd>
                </dl>
            </li>
                        <li>
                <a href="/ai/13105.html"  target="_blank" title="万象有声 - AI 一站式有声内容创作平台" class="img_box">
                    <img src="/uploads/ai/20260615/50267bac-icon-c146b001b5.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="万象有声 - AI 一站式有声内容创作平台" style="object-fit:cover;width:100%;height:100%;">
                </a>
                <dl>
                    <dt class="lineTwoOverflow"><a href="/ai/13105.html" class="aBlack" target="_blank" title="万象有声">万象有声</a></dt>
                    <dd class="cont1 lineTwoOverflow">
                        万象有声,一个专为有声创作者打造的新一代智能有声内容创作平台。平台提供专业的智能拆章、智能画本编辑、AI配音、AI生成音效、后期制作、智能对轨、智能审听等有声创作全流程工具,可以帮助创作者高效、低成本创作出引人入胜的有声作品。立即体验,让有声书制作更简单!                    </dd>
                    <dd class="cont2">4256次使用</dd>
                </dl>
            </li>
                    </ul>
    </div>
        <!-- 相关文章 -->
        <div class="rightContBox">
            <div class="rightTit">
                <a href="/articlelist.html" class="more" title="查看更多">查看更多<i class="iconfont">&#xe603;</i></a>
                <div class="tit lineOverflow">相关文章</div>
            </div>
            <ul class="aboutArticleRList">
                                <li>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/article/16343.html"  class="aBlack" title="用Nginx反向代理部署go写的网站。">用Nginx反向代理部署go写的网站。</a></dt>
                        <dd>
                            <span class="left">2023-01-17</span>
                            <span class="right">502浏览</span>
                        </dd>
                    </dl>
                </li>
                                <li>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/article/15715.html"  class="aBlack" title="GoLand调式动态执行代码">GoLand调式动态执行代码</a></dt>
                        <dd>
                            <span class="left">2023-01-13</span>
                            <span class="right">502浏览</span>
                        </dd>
                    </dl>
                </li>
                                <li>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/article/129109.html"  class="aBlack" title="从不同的 go 例程将数据写入同一通道无需等待组即可正常工作">从不同的 go 例程将数据写入同一通道无需等待组即可正常工作</a></dt>
                        <dd>
                            <span class="left">2024-04-29</span>
                            <span class="right">501浏览</span>
                        </dd>
                    </dl>
                </li>
                                <li>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/article/127975.html"  class="aBlack" title="Golang rsa-oaep解密失败,前端使用webcrypto">Golang rsa-oaep解密失败,前端使用webcrypto</a></dt>
                        <dd>
                            <span class="left">2024-04-26</span>
                            <span class="right">501浏览</span>
                        </dd>
                    </dl>
                </li>
                                <li>
                    <dl>
                        <dt class="lineTwoOverflow"><a href="/article/127286.html"  class="aBlack" title="如何从用户输入以惰性方式初始化包的全局变量?">如何从用户输入以惰性方式初始化包的全局变量?</a></dt>
                        <dd>
                            <span class="left">2024-04-24</span>
                            <span class="right">501浏览</span>
                        </dd>
                    </dl>
                </li>
                            </ul>
        </div>
    </div>
</div>
<div class="footer">
    <div class="footerIn">
        <div class="footLeft">
            <div class="linkBox">
                <a href="/about/1.html"  target="_blank" class="aBlack" title="关于我们">关于我们</a>
                <a href="/about/5.html" target="_blank" class="aBlack" title="免责声明">免责声明</a>
                <a href="#" class="aBlack"  title="意见反馈">意见反馈</a>
                <a href="/about/2.html" class="aBlack" target="_blank" title="联系我们">联系我们</a>
                <a href="/send.html" class="aBlack"  title="广告合作">内容提交</a>
                 <a href="/manual/go/" target="_blank" class="aBlack" title="手册">手册</a>
            </div>
            <div class="footTip">Golang学习网:公益在线Go学习平台,帮助Go学习者快速成长!</div>
            <div class="shareBox">
                <span><i class="qq"></i>技术交流群</span>
            </div>
            <div class="copyRight">
                Copyright 2023 http://www.17golang.com/ All Rights Reserved | <a href="https://beian.miit.gov.cn/" target="_blank" title="备案">苏ICP备2023003363号-1</a>
            </div>
        </div>
        <div class="footRight">
            <ul class="encodeList">
                
                <li>
                    <div class="encodeImg">
                        <img src="/assets/examples/qrcode_for_gh.jpg" alt="Golang学习网">
                    </div>
                    <div class="tit">关注公众号</div>
                    <div class="tip">Golang学习网</div>
                </li>
                <div class="clear"></div>
            </ul>
        </div>
        <div class="clear"></div>
    </div>
</div>
<!-- 微信登录弹窗 -->
<style>
 .popupBg .n-error{
  color: red;
 }
  </style>
<div class="popupBg">
    <div class="loginBoxBox">
      <div class="imgbg">
        <img src="/assets/images/leftlogo.jpg" alt="">
      </div>
      <!-- 微信登录 -->
      <div class="loginInfo encodeLogin" style="display: none;">
        <div class="closeIcon" onclick="$('.popupBg').hide();"></div>
        <div class="changeLoginType cursorPointer create_wxqrcode" onclick="$('.loginInfo').hide();$('.passwordLogin').show();">
          <div class="tip">密码登录在这里</div>
        </div>
        <div class="encodeInfo">
          <div class="tit"><i></i> 微信扫码登录或注册</div>
          <div class="encodeImg">
            <span id="wx_login_qrcode"><img src="/assets/examples/code.png"  alt="二维码"></span>
            <!-- <div class="refreshBox">
              <p>二维码失效</p>
              <button type="button" class="create_wxqrcode">刷新1111</button>
            </div> -->
          </div>
          <div class="tip">打开微信扫一扫,快速登录/注册</div>
        </div>
        <div class="beforeLoginTip">登录即同意 <a href="#" class="aBlue" title="用户协议">用户协议</a> 和 <a href="#" class="aBlue" title="隐私政策">隐私政策</a></div>
      </div>
      <!-- 密码登录 -->
      <div class="loginInfo passwordLogin">
        <div class="closeIcon" onclick="$('.popupBg').hide();"></div>
        <div class="changeLoginType cursorPointer create_wxqrcode" onclick="$('.loginInfo').hide();$('.encodeLogin').show();">
          <div class="tip">微信登录更方便</div>
        </div>
        <div class="passwordInfo">
          <ul class="logintabs selfTabMenu">
            <li class="selfTabItem loginFormLi curr">密码登录</li> 
            <li class="selfTabItem registerFormBox ">注册账号</li>
          </ul>
          <div class="selfTabContBox">
            <div class="selfTabCont loginFormBox" style="display: block;">
              <form name="form" id="login-form" class="form-vertical form" method="POST" action="/index/user/login">
                <input type="hidden" name="url" value="//17golang.com/article/93949.html"/>
                <input type="hidden" name="__token__" value="b139d275f5340850f3fade11a956408f" />                <div class="form-group" style="height:70px;">
                  <input class="form-control" id="account" type="text" name="account" value="" data-rule="required" placeholder="邮箱/用户名" autocomplete="off">
                </div>
                <div class="form-group" style="height:70px;">
                  <input class="form-control" id="password" type="password" name="password" data-rule="required;password" placeholder="密码" autocomplete="off">
                </div>
                <div class="codeBox" style="height:70px;">
                  <div class="form-group" style="height:70px; width:205px; float: left;">
                    <input type="text" name="captcha" class="form-control" placeholder="验证码" data-rule="required;length(4)" />
                  </div>
                <span class="input-group-btn" style="padding:0;border:none;">
                    <img src="/captcha.html" width="100" height="45" onclick="this.src = '/captcha.html?r=' + Math.random();"/>
                </span>
              </div>
                <div class="other">
                  <a href="#" class="forgetPwd aGray" onclick="$('.loginInfo').hide();$('.passwordForget').show();" title="忘记密码">忘记密码</a>
                </div>
                <div class="loginBtn mt25">
                  <button type="submit">登录</button>
                </div>
              </form>
            </div>
            <div class="selfTabCont registerFormBox" style="display: none;">
                <form name="form1" id="register-form" class="form-vertical form" method="POST" action="/index/user/register">
                <input type="hidden" name="invite_user_id" value="0"/>
                <input type="hidden" name="url" value="//17golang.com/article/93949.html"/>
                <input type="hidden" name="__token__" value="b139d275f5340850f3fade11a956408f" />                <div class="form-group" style="height:70px;">
                <input type="text" name="email" id="email2" data-rule="required;email" class="form-control" placeholder="邮箱">
              </div>
                <div class="form-group" style="height:70px;">
                <input type="text" id="username" name="username" data-rule="required;username" class="form-control" placeholder="用户名必须3-30个字符">
                </div>
                <div class="form-group" style="height:70px;">
                <input type="password" id="password2" name="password" data-rule="required;password" class="form-control" placeholder="密码必须6-30个字符">
              </div>
                <div class="codeBox" style="height:70px;">
                  <div class="form-group" style="height:70px; width:205px; float: left;">
                    <input type="text" name="captcha" class="form-control"  placeholder="验证码" data-rule="required;length(4)" />
                  </div>
                <span class="input-group-btn" style="padding:0;border:none;">
                    <img src="/captcha.html" width="100" height="45" onclick="this.src = '/captcha.html?r=' + Math.random();"/>
                </span>
              </div>
               
                <div class="loginBtn">
                  <button type="submit">注册</button>
                </div>
              </form>
            </div>
          </div>
        </div>
        <div class="beforeLoginTip">登录即同意 <a href="https://www.17golang.com/about/3.html" target="_blank" class="aBlue" title="用户协议">用户协议</a> 和 <a href="https://www.17golang.com/about/4.html" target="_blank" class="aBlue" title="隐私政策">隐私政策</a></div>
      </div>
		<!-- 重置密码 -->
		<div class="loginInfo passwordForget">
			<div class="closeIcon" onclick="$('.popupBg').hide();"></div>
			<div class="returnLogin cursorPointer" onclick="$('.passwordForget').hide();$('.passwordLogin').show();">返回登录</div>
			<div class="passwordInfo">
			<ul class="logintabs selfTabMenu">
				<li class="selfTabItem">重置密码</li>
			</ul>
			<div class="selfTabContBox">
				<div class="selfTabCont">
				<form id="resetpwd-form" class="form-horizontal form-layer nice-validator n-default n-bootstrap form" method="POST" action="/api/user/resetpwd.html" novalidate="novalidate">
          <div style="height:70px;">
          <input type="text" class="form-control" id="email" name="email" value="" placeholder="输入邮箱" aria-invalid="true">
        </div>
					
          <div class="codeBox" style="height:70px;">
            <div class="form-group" style="height:70px; width:205px; float: left;">
              <input type="text" name="captcha" class="form-control"  placeholder="验证码" />
            </div>
            <span class="input-group-btn" style="padding:0;border:none;">
                <a href="javascript:;" class="btn btn-primary btn-captcha cursorPointer" style="background: #2080F8; border-radius: 4px; color: #fff; padding: 12px;
                position: absolute;" data-url="/api/ems/send.html" data-type="email" data-event="resetpwd">发送验证码</a>
            </span>
        </div>

					 <input type="password" class="form-control" id="newpassword" name="newpassword" value="" placeholder="请输入6-18位密码">
			

					<div class="loginBtn mt25">
					<button type="submit">重置密码</button>
					</div>
				</form>
				</div>
			</div>
			</div>
		</div>
    </div>
  </div>


<script src="/assets/js/juejin-theme.js?v=20260613b" defer></script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?e34c3e8ab31ba35d7e1c48ea8d77315f";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

<script src="/assets/js/frontend/common.js"></script>
</body>
</html>