From a3213e3dd7fc9a7fdaa402dacccf7a554dc2a848 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Fri, 24 Feb 2023 03:58:50 -0500 Subject: fix(go): apply indents in a communication case in a select statement --- queries/go/indents.scm | 1 + tests/indent/go/select.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/indent/go/select.go diff --git a/queries/go/indents.scm b/queries/go/indents.scm index c6ac18969..e21fc8771 100644 --- a/queries/go/indents.scm +++ b/queries/go/indents.scm @@ -6,6 +6,7 @@ (func_literal) (literal_value) (expression_case) + (communication_case) (default_case) (block) (call_expression) diff --git a/tests/indent/go/select.go b/tests/indent/go/select.go new file mode 100644 index 000000000..e3610f8f1 --- /dev/null +++ b/tests/indent/go/select.go @@ -0,0 +1,16 @@ +// issue #4248 +package main + +import ( + "context" + "fmt" +) + +func test(ch byte) { + ctx := context.TODO() + select { + case <-ctx.Done(): + fmt.Println("indentation") + default: + } +} -- cgit v1.2.3-70-g09d2