RSPEC-1192 문자열 리터럴은 중복되지 않아야 한다

1 개요[ | ]

RSPEC-1192, S1192
String literals should not be duplicated
문자열 리터럴은 중복되지 않아야 한다
func run() {
	prepare("This should be a constant")  // Noncompliant; 'This should ...' is duplicated 3 times
	execute("This should be a constant")
	release("This should be a constant")
}
const ACTION = "This should be a constant"

func run() {
	prepare(ACTION)
	execute(ACTION)
	release(ACTION)
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}