Q: Go 언어에서 string enum을 사용하는 예를 보여줘. [[icon(chatgpt.png)]]ChatGPT: Go 언어는 열거형(enum)을 지원하지 않습니다. 따라서 string enum을 사용하려면 문자열 상수(constant)를 정의해야 합니다. 이를 예를 들어 설명해 보겠습니다. {{{#!vim go package main import "fmt" const ( Red = "RED" Green = "GREEN" Blue = "BLUE" ) func main() { var color string = Red switch color { case Red: fmt.Println("The color is red.") case Green: fmt.Println("The color is green.") case Blue: fmt.Println("The color is blue.") default: fmt.Println("Invalid color.") } } }}}