golang的map实现原理
hashMap一般有两个实现方案:开放寻址法(往后错位)和拉链法(槽内是链表)。

- go map 其实是用的拉链法,首先有一个hmap的结构,存放了 2^B 个桶。
- map 的数据被置入一个由桶组成的有序数组中,每个桶最多可以存放 8 个 key/value,超了则会链接到额外的溢出桶。
- 基本数据结构是 (桶数组 + 桶内的key-value数组 + 溢出的桶链表)。

hashMap一般有两个实现方案:开放寻址法(往后错位)和拉链法(槽内是链表)。


slice 切片,也可以理解为动态数组。与数组相比切片的长度是不固定的,可以追加元素,在追加时可能使切片的容量增大。
每次都被 defer,panic和recover 坑的死去活来,今天抽出时间来整理一下。
(软件包安装的单元)
The expectation is that /lib/systemd/system is a directory that should only contain systemd unit files which were put there by the package manager (YUM/DNF/RPM/APT/etc).
(系统管理员安装的单元, 优先级更高)
Files in /etc/systemd/system are manually placed here by the operator of the system for ad-hoc software installations that are not in the form of a package. This would include tarball type software installations or home grown scripts.