From 179cf24fba7be9eb02f7553ccb982412226e6780 Mon Sep 17 00:00:00 2001 From: qaqland <62464571+qaqland@users.noreply.github.com> Date: Sat, 15 Jan 2022 17:01:37 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E8=A6=81=E4=B8=80=E4=B8=AA=E6=AD=A3?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ count.go | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..38a7bcb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +a.nex +test.go \ No newline at end of file diff --git a/count.go b/count.go index a1504c8..2237248 100644 --- a/count.go +++ b/count.go @@ -1,6 +1,8 @@ package main -import "fmt" +import ( + "fmt" +) type charset struct { Name string @@ -22,7 +24,7 @@ func fas_sum() []dna { func fas_count(sum_nex []dna) []charset { fas_charset := []charset{} for k, v := range sum_nex { - n := v.name + n := fas_name(v.name) f := 1 if k != 0 { f = fas_charset[k-1].To + 1 @@ -35,3 +37,9 @@ func fas_count(sum_nex []dna) []charset { fmt.Println(fas_charset) return fas_charset } + +func fas_name(old_name string) string { + // 需要 最后一个/开始,一个.结束 中间的部分 + // 正则表达式 + return old_name +}