From b5644afd0759abe32fd29a6af9bc58cf2d0801b1 Mon Sep 17 00:00:00 2001 From: lixiang Date: Wed, 20 Nov 2024 06:42:07 +0000 Subject: [PATCH] fix some errors Signed-off-by: lixiang --- controllers/tag.go | 4 ++-- docs/architecture.md | 2 +- models/scripts.go | 4 ++-- vendor/github.com/beego/beego/v2/README.md | 4 ++-- vendor/github.com/beego/beego/v2/core/utils/debug.go | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/controllers/tag.go b/controllers/tag.go index ada4182..d9d0570 100644 --- a/controllers/tag.go +++ b/controllers/tag.go @@ -62,8 +62,8 @@ type TagActionController struct { func (tuc *TagActionController) Put() { tagName := tuc.Ctx.Input.Param(":tag_name") - atcion := tuc.Ctx.Input.Param(":action") - tuc.Data["json"] = models.TagAction(tagName,atcion) + action := tuc.Ctx.Input.Param(":action") + tuc.Data["json"] = models.TagAction(tagName,action) tuc.ServeJSON() } diff --git a/docs/architecture.md b/docs/architecture.md index 7c40ecc..1dbb63c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -6,7 +6,7 @@ TODO: 待补充图片 -总体来讲,ha-api后端封装了很多的HA软件管理命令行,例如pcs, crm_xxx, cibamdin等。然后通过ha-web项目提供一个易于使用的前端界面来监控和管理HA集群。 +总体来讲,ha-api后端封装了很多的HA软件管理命令行,例如pcs, crm_xxx, cibadmin等。然后通过ha-web项目提供一个易于使用的前端界面来监控和管理HA集群。 ## 代码结构 diff --git a/models/scripts.go b/models/scripts.go index 70633f8..2e87444 100644 --- a/models/scripts.go +++ b/models/scripts.go @@ -65,7 +65,7 @@ func GenerateLocalScript(data map[string]string) error { stopCommand := data["stop"] monitorCommand := data["monitor"] filePath := filepath.Join("/usr/lib/ocf/resource.d/pacemaker/", name) - scriptTemplete := + scriptTemplate := `#!/bin/sh # # Author: Kylin @@ -216,7 +216,7 @@ exit $?` } defer file.Close() // 确保文件在函数结束时关闭 - if _, err := file.WriteString(scriptTemplete); err != nil { + if _, err := file.WriteString(scriptTemplate); err != nil { return errors.Wrap(err, "write script file failed") } diff --git a/vendor/github.com/beego/beego/v2/README.md b/vendor/github.com/beego/beego/v2/README.md index 4279b23..62cc45a 100644 --- a/vendor/github.com/beego/beego/v2/README.md +++ b/vendor/github.com/beego/beego/v2/README.md @@ -8,7 +8,7 @@ embedding. ![architecture](https://cdn.nlark.com/yuque/0/2020/png/755700/1607857489109-1e267fce-d65f-4c5e-b915-5c475df33c58.png) -Beego is compos of four parts: +Beego is composed of four parts: 1. Base modules: including log module, config module, governor module; 2. Task: is used for running timed tasks or periodic tasks; @@ -95,5 +95,5 @@ Congratulations! You've just built your first **beego** app. ## License -beego source code is licensed under the Apache Licence, Version 2.0 +beego source code is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html). diff --git a/vendor/github.com/beego/beego/v2/core/utils/debug.go b/vendor/github.com/beego/beego/v2/core/utils/debug.go index 93c27b7..8c2394e 100644 --- a/vendor/github.com/beego/beego/v2/core/utils/debug.go +++ b/vendor/github.com/beego/beego/v2/core/utils/debug.go @@ -60,7 +60,7 @@ func display(displayed bool, data ...interface{}) string { fmt.Fprintf(buf, "\n[Variables]\n") for i := 0; i < len(data); i += 2 { - var output = fomateinfo(len(data[i].(string))+3, data[i+1]) + var output = formatinfo(len(data[i].(string))+3, data[i+1]) fmt.Fprintf(buf, "%s = %s", data[i], output) } @@ -71,7 +71,7 @@ func display(displayed bool, data ...interface{}) string { } // return data dump and format bytes -func fomateinfo(headlen int, data ...interface{}) []byte { +func formatinfo(headlen int, data ...interface{}) []byte { var buf = new(bytes.Buffer) if len(data) > 1 { -- Gitee