FAQ
I was careless about project organization before and now I'm paying for it.

It's an old project and I put everything in the main package.

The names are long and confusing and (supposed to be-) isolated modules are
sharing their private types and values.

I'd like to move some pieces of the code to new packages. The moved code
has references and I would have to rename to include the new package name
(like <moved_type> to <new_package.moved_type>.)

I tried gorename, but as soon as I move code to a new package and old
references become undeclared errors, gorename refuses to refactor because
of those errors.

Is there any tool that allows this kind of renaming?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Konstantin Kulikov at Feb 8, 2016 at 12:08 pm
    Hey.
    Have a look at this thread
    https://groups.google.com/forum/#!searchin/golang-nuts/Tool$20to$20move$20identifier$20into$20new$20package/golang-nuts/VPixcdMCVkE/5X8WBfXgBAAJ
    I am not aware of any finished tool though.
    On Sun, Feb 7, 2016 at 11:13 PM Zippoxer wrote:

    I was careless about project organization before and now I'm paying for it.

    It's an old project and I put everything in the main package.

    The names are long and confusing and (supposed to be-) isolated modules
    are sharing their private types and values.

    I'd like to move some pieces of the code to new packages. The moved code
    has references and I would have to rename to include the new package name
    (like <moved_type> to <new_package.moved_type>.)

    I tried gorename, but as soon as I move code to a new package and old
    references become undeclared errors, gorename refuses to refactor because
    of those errors.

    Is there any tool that allows this kind of renaming?

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Sam Whited at Feb 9, 2016 at 12:02 am

    On Sun, Feb 7, 2016 at 7:09 AM, Zippoxer wrote:
    Is there any tool that allows this kind of renaming?
    At the risk of sounding snarky: Why not just use a mix of grep and sed?

    Sometimes the simplest tools are the best tools.

    Best,
    Sam


    --
    Sam Whited
    pub 4096R/54083AE104EA7AD3
    https://blog.samwhited.com

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Zippoxer at Feb 9, 2016 at 7:23 pm
    Confidence I guess. I'm afraid I might damage my code. The words I'd need
    to replace are also used inside strings :\
    On Tuesday, February 9, 2016 at 2:02:56 AM UTC+2, Sam Whited wrote:

    On Sun, Feb 7, 2016 at 7:09 AM, Zippoxer <zipp...@gmail.com <javascript:>>
    wrote:
    Is there any tool that allows this kind of renaming?
    At the risk of sounding snarky: Why not just use a mix of grep and sed?

    Sometimes the simplest tools are the best tools.

    Best,
    Sam


    --
    Sam Whited
    pub 4096R/54083AE104EA7AD3
    https://blog.samwhited.com
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 7, '16 at 8:13p
activeFeb 9, '16 at 7:23p
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase