From 42a8d19afe50fae8fb9f195c45fec6ccb46ced32 Mon Sep 17 00:00:00 2001 From: Viviman_hp Date: Thu, 22 Jul 2021 08:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=BF=E8=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../使用配置文件添加校验规则.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/golang_learn/data_office/get_excel_velidation/使用配置文件添加校验规则.go b/golang_learn/data_office/get_excel_velidation/使用配置文件添加校验规则.go index e7492bb..97056c0 100644 --- a/golang_learn/data_office/get_excel_velidation/使用配置文件添加校验规则.go +++ b/golang_learn/data_office/get_excel_velidation/使用配置文件添加校验规则.go @@ -10,7 +10,7 @@ import ( func main() { glog.Info("开始-读取配置文件...") - config := initFunc() + config := initFunc2() if config == nil { return } @@ -25,7 +25,7 @@ func main() { } glog.Info("开始-读取文件内容获取异常单元格列表...") - cells, err := readExcel(xlsx, sheetName) + cells, err := readExcel2(xlsx, sheetName) if err != nil { return } @@ -80,12 +80,12 @@ func makeExcelStyle2(xlsx *excelize.File, sheetName string, cells map[int]string /** initFunc 执行读取 yaml 配置文件 */ -func initFunc2() *Config { +func initFunc2() *Config2 { path, _ := filepath.Abs("./") path += "\\config.yaml" glog.Info("读取配置文件:", path) path = "D:\\ViviCode\\golangs_learn\\golang_learn\\data_office\\get_excel_velidation\\config.yaml" - load, err := load(path) + load, err := load2(path) if err != nil { glog.Error("读取文件发生异常...") return nil @@ -104,8 +104,8 @@ type Config2 struct { /** load 解析 Yaml 文件 */ -func load2(path string) (*Config, error) { - conf := new(Config) +func load2(path string) (*Config2, error) { + conf := new(Config2) yamlFile, err := ioutil.ReadFile(path) if err != nil { glog.Info("发生异常:", err)