소스 검색

chore: refactor to use const instead of var (#1731)

Kevin Wan 3 년 전
부모
커밋
ac18cc470d
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      tools/goctl/util/head.go

+ 5 - 3
tools/goctl/util/head.go

@@ -1,10 +1,12 @@
 package util
 
-// DoNotEditHead added to the beginning of a file to prompt the user not to edit
-var DoNotEditHead = "// Code generated by goctl. DO NOT EDIT!"
+const (
+	// DoNotEditHead added to the beginning of a file to prompt the user not to edit
+	DoNotEditHead = "// Code generated by goctl. DO NOT EDIT!"
 
-var headTemplate = `// Code generated by goctl. DO NOT EDIT!
+	headTemplate = DoNotEditHead + `
 // Source: {{.source}}`
+)
 
 // GetHead returns a code head string with source filename
 func GetHead(source string) string {