Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix(bug): where Go compiler directives weren't detected

Elijah Potter3783af8da72e
diff --git a/harper-ls/src/comment_parsers/go.rs b/harper-ls/src/comment_parsers/go.rs
index ffb85cac9..2324379f7 100644
--- a/harper-ls/src/comment_parsers/go.rs
+++ b/harper-ls/src/comment_parsers/go.rs
@@ -11,8 +11,8 @@ impl Parser for Go {
let mut actual = without_intiators(source);
let mut actual_source = actual.get_content(source);
- if matches!(source, ['g', 'o', ':', ..]) {
- let Some(terminator) = source.iter().position(|c| c.is_whitespace()) else {
+ if matches!(actual_source, ['g', 'o', ':', ..]) {
+ let Some(terminator) = source.iter().position(|c| *c == '\n') else {
return Vec::new();
};