From 6d99af7bbc4ac6b4ec1a25bf99b12e3bdb6be78a Mon Sep 17 00:00:00 2001 From: Alex Bezzubov Date: Thu, 16 Feb 2023 17:46:23 +0100 Subject: [PATCH] doc: reformat & clarify --- data/rule/rule.go | 4 +++- enry.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/data/rule/rule.go b/data/rule/rule.go index 50da701..8ad4397 100644 --- a/data/rule/rule.go +++ b/data/rule/rule.go @@ -124,7 +124,9 @@ func (r always) Match(data []byte) bool { return true } -// checks if regular expression syntax isn't accepted by RE2 engine +// Checks if a regex syntax isn't accepted by RE2 engine. +// It's nil by construction from regex.MustCompileRuby but +// is used here as a Matcher interface wich itself is non-nil. func runOnRE2AndRegexNotAccepted(re Matcher) bool { v, ok := re.(regex.EnryRegexp) return ok && v == nil diff --git a/enry.go b/enry.go index 769ca4f..0cf3c31 100644 --- a/enry.go +++ b/enry.go @@ -1,15 +1,15 @@ /* - Package enry implements multiple strategies for programming language identification. +Package enry identifies programming languages. - Identification is made based on file name and file content using a service - of strategies to narrow down possible option. - Each strategy is available as a separate API call, as well as a main enty point +Identification is based on file name and content using a series +of strategies to narrow down possible options. +Each strategy is available as a separate API call, as well as though the main enty point: - GetLanguage(filename string, content []byte) (language string) + GetLanguage(filename string, content []byte) (language string) - It is a port of the https://github.com/github/linguist from Ruby. - Upstream Linguist YAML files are used to generate datastructures for data - package. +It is a port of the https://github.com/github/linguist from Ruby. +Upstream Linguist YAML files are used to generate datastructures for data +package. */ package enry // import "github.com/go-enry/go-enry/v2"