interfacer

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README ยถ

Interfacer

English | ไธญๆ–‡ๆ–‡ๆกฃ

Implement new methods in the interface everywhere

ๅฟซ้€Ÿ็ป™็Žฐๆœ‰ๆŽฅๅฃๆทปๅŠ ๆ–ฐๆ–นๆณ•๏ผŒ็ป™็›ธๅ…ณ็ป“ๆž„่‡ชๅŠจ็”Ÿๆˆ้ป˜่ฎคๅฎž็Žฐ

effect

๐ŸŽ‰ Effect

effect

๐Ÿค”๏ธ Why this tool

When you add a method to an interface, the corresponding implementation cannot be found after adding the method. Because of the addition of an additional method, the previous implementations are all invalid. In general, adding a method to an interface is cumbersome and time-consuming.

๐Ÿ“š Getting started

๐Ÿ“œ Install

There are three ways to install it, including:

  1. Binary file

    you can get the latest version by the link: interfacer

  2. Install by go install

    Tips: If you use the windows, you can download the source code and build the tool.

    go install github.com/SimFG/interfacer
    
  3. Source build

    a. clone the repository

    git clone github.com/SimFG/interfacer
    

    b. build

    go  build interfacer.go interfacer_handle.go
    
๐Ÿ”ฌ Detailed usage

link: USAGE

๐Ÿชง Tips

Some problems may be encountered during use, as the tool is currently under development. You can give me an issue If you encounter any problems using.

๐Ÿงญ Roadmap

  • Dealing with generated code out of order of comments
    • for interface โœ…
    • for struct method
  • Exclude dirs or files
    • accurate โœ…
    • fuzzy matching
  • Debug mode, print the detail info โœ…
  • It will be ignored if the new method has existed โœ…
  • Scan many third modules' files and then get all the implements of the interface, like the protobuf interface โœ…
  • Check the input params โœ…
  • Customer the configuration yaml file path โœ…
  • Update the Chinese README file โœ…
  • Beautify the README file โœ…
  • Dynamic display of program running time โœ…
  • Show scan progress โœ…
  • Using the function name and receiver type to check whether the method has existed โœ…
  • Configure whether to add a new line when generating the new method for the interface โœ…
  • Support the use of go generate annotations in the program โœ…
  • Handle the no name params in the method, like foo(bool) โœ…
  • Configure whether to add the new method if the inner struct or interface has contained the new method
  • Individually add a method for different structs that implements different interfaces of the third modules
  • Write the method content easily by the way similar to writing interface
  • Contributing doc
  • Handle the more params that are the same type, like foo(a, b bool)
  • Idea plugin
  • Customer the insert position
  • Generate more complex default method implement by the template
  • Support to generate more methods
  • More readable codes
  • Handle the un-import interface or struct param when adding the new method
  • Handle some special struct or interface
  • More useful tool of reading and writing go file
  • Ast example doc

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL