1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00
emacs/test/lisp/progmodes/go-ts-mode-resources/indent.erts
Davide Masserut 89b550eac2 Fix switch statement indentation for go-ts-mode (bug#61238)
* lisp/progmodes/go-ts-mode.el (go-ts-mode--indent-rules): Add
indentation for type switch and select case blocks
* test/lisp/progmodes/go-ts-mode-resources/indent.erts: New .erts file
to test indentation of Go constructs and prevent regression of bug
fixes.
* test/lisp/progmodes/go-ts-mode-tests.el: New file with go-ts-mode
tests.
2023-02-04 19:26:05 +01:00

47 lines
502 B
Text

Code:
(lambda ()
(go-ts-mode)
(indent-region (point-min) (point-max)))
Point-Char: |
Name: Basic
=-=
package main
func main() {
}
=-=-=
Name: Switch and Select
=-=
package main
func main() {
var x any
switch x {
case 1:
println("one")
default:
println("default case")
}
switch x.(type) {
case int:
println("integer")
default:
println("don't know the type")
}
var c chan int
select {
case x := <-c:
println(x)
default:
println("no communication")
}
}
=-=-=