Giter Site home page Giter Site logo

robinsound / vscode-go-impl-methods Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ricardoerikson/vscode-go-impl-methods

0.0 0.0 0.0 786 KB

Visual Studio Code extension to automatically implement interface methods for Golang

License: MIT License

JavaScript 14.11% TypeScript 84.51% Go 1.38%

vscode-go-impl-methods's Introduction

Implement Method Stubs for Golang Interfaces - Visual Studio Code Extension

GitHub Workflow Status (branch) GitHub release (latest SemVer) semantic-release GitHub Version Installs

VS Code extension that automatically generates method stubs for Golang interfaces. Just inform the receiver and the interface. The extension will generate the method stubs.

Usage

Requirements

First, you will need to have your Go environment correctly configured. The path folder for your Go binaries must also be added to the environment variable $PATH in your operating system. Please, find below some guidelines on how to do that in your operating system:

Then, you will need to install the impl package as follows:

go get -u github.com/josharian/impl

Obs: make sure your $GOPATH/bin is in your $PATH so that you can access the impl binary.

Usage

  • Inform the receiver as a comment (see some examples below):
    • // mt MyType
    • // mp *MyPointer
  • Open the Command Palette
    • Ctrl+Shift+P (Linux and Windows)
    • Shift+Command+P (macOS)
  • Look for Go: Implement Interface Methods
  • Start typing the name of the interface and pick it from the list (ex: io.Reader)
  • Hit Enter!

Author

Ricardo Erikson

Comments

The extension is working, but there are a few things to improve. Any suggestions are welcomed. Please, feel free to contribute.

Enjoy!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.