知識冒險者

data-structure

此標籤下有 13 條筆記。

  • 2026年9月17日

    Go 建立 map 的三種寫法

    • go
    • data-structure
  • 2026年9月17日

    Go 的 map 讀取不存在的 key 會回傳 zero value

    • go
    • data-structure
    • gotcha
  • 2026年9月17日

    Go 的 struct 是一組具名欄位的集合

    • go
    • data-structure
  • 2026年9月17日

    nil map 可以讀但不能寫

    • go
    • data-structure
    • gotcha
  • 2026年8月30日

    Go 傳 slice 是複製 header 而不是 pass by reference

    • go
    • data-structure
  • 2026年8月30日

    Go 的 slice、map、func 不能用相等運算子比較

    • go
    • data-structure
  • 2026年8月30日

    Go 的切割上限是 cap 而不是 len

    • go
    • data-structure
  • 2026年8月30日

    Go 移除 slice 特定 index 的元素會打亂順序

    • go
    • data-structure
  • 2026年8月30日

    Slice 是看向底層 array 的一扇窗戶

    • go
    • data-structure
  • 2026年8月30日

    Slice 的四種建立方式與 nil

    • go
    • data-structure
  • 2026年8月30日

    append 的行為取決於 cap 夠不夠

    • go
    • data-structure
  • 2026年8月30日

    copy 是唯一真的複製 slice 資料的方式

    • go
    • data-structure
  • 2026年8月30日

    切割出的 slice 預設 cap 吃到底,append 會寫進鄰居的地盤

    • go
    • data-structure

Created with Quartz v5.0.0 © 2026