DEV Community

Cover image for [Go] Speed up your refactoring with GoLand
Julian-Chu
Julian-Chu

Posted on • Edited on

2

[Go] Speed up your refactoring with GoLand

This is a video demo, how to use different refactoring feature in GoLand to speed up you productivity when doing refactor.

Original example is from "extract variable" section of refactoring 2/e.
Rewriting it with golang.

Code smells:

  1. magic number
  2. comments don't match code behavior

Refactoring features:

  1. extract variable(ctrl+alt+v)/ extract const(ctrl+alt+c)
  2. extract method(ctrl+alt+m)
  3. inline variable(ctrl+alt+n)
  4. move method to struct(manual)
  5. move struct and receiver functions(F6)

more useful features in GoLand: top 25 editing features of goland

Top comments (1)

Collapse
 
julianchu profile image
Julian-Chu

Hi Arber, thanks for your suggestion. If next time I make new video demo, will try to add explanation.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay