Changeset 10 in code for trunk/web/main.go


Ignore:
Timestamp:
Sep 30, 2022, 8:16:23 PM (3 years ago)
Author:
fattalion
Message:

Make some identifiers more concise

See https://go.dev/doc/effective_go#package-names, specifically:

The importer of a package will use the name to refer to its contents,
so exported names in the package can use that fact to avoid
repetition.

For example, engines.GoogleTranslateEngine needlessly repeats
"engine," so just get rid of that duplication by renaming it to
engines.GoogleTranslate.

Renaming engines.TranslationEngine to engines.Engine may be
debatable, so if somebody disagrees, feel free to leave a comment
stating your disagreement and with an explanation of why you disagree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/main.go

    r9 r10  
    88
    99func main() {
    10         engine := &engines.GoogleTranslateEngine{}
     10        engine := &engines.GoogleTranslate{}
    1111        print(engine.DisplayName())
    1212}
Note: See TracChangeset for help on using the changeset viewer.