Workspace

KMP

March 22, 2022
Algorithm, KMP
Workspace

KMP字符串匹配算法 精确匹配 状态机 给定一个pattern,查找其在另一字符串s出现的最早位置。(找不到则返回-1) func index(s string, pattern string) int { return -1 } 状态推移 func index(s string, pattern string) int { n := len(s) m := len(pattern) // 根据pattern构造dp var dp [n][m]int // 在s上应用dp,判断pattern位置 return -1 }

go work

February 10, 2022
Go, Work
Workspace

go1.18将要推出workspace模式,此举是为了方便在本地开发多个不同module时的依赖管理。 命令说明: $ go help work Go workspace provides access to operations on workspaces. Note that support for workspaces is built into many other commands, not just 'go work'. See 'go help modules' for information about Go\'s module system of which workspaces are a part. A workspace is specified by a go.work file that specifies a set of module directories with the "use" directive. These modules are used as root modules by the go command for builds and related operations. ...