导入包而不进行优化

I want to debug a program with delve. However I got the following error. "Warning: debugging optimized function"

Seems, the imported package is optimized. Are there any ways to avoid this issue?

error

250:        if change {
251:            return b.wallet.NewChangeAddress(defaultAccount, keyScope)
252:        }
253:
=> 254:     return b.wallet.NewAddress(defaultAccount, keyScope)
255:    }

(dlv) s
> github.com/btcsuite/btcwallet/wallet.(*Wallet).NewAddress() ./pkg/mod/github.com/btcsuite/btcwallet@v0.0.0-20190213034619-b51c1adeee55/wallet/wallet.go:2939 (PC: 0x92a948)
Warning: debugging optimized function

source code

import (
    base "github.com/btcsuite/btcwallet/wallet"
)

...

func (b *BtcWallet) NewAddress(t lnwallet.AddressType, change bool) (btcutil.Address, error) {
...
    return b.wallet.NewAddress(defaultAccount, keyScope)
}

https://github.com/lightningnetwork/lnd/blob/master/lnwallet/btcwallet/btcwallet.go#L254


Update 1

I found that the Makefile of the program had some optimization configurations.

https://github.com/lightningnetwork/lnd/blob/master/Makefile#L18

I disabled the optimization and rebuild it but it still does not work.

-LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT)"
+LDFLAGS :=

-GOBUILD := GO111MODULE=on go build -v
+GOBUILD := GO111MODULE=on go build -v -gcflags '-N -l'