refactor(core): simplify Lnk creation with functional options pattern

This commit is contained in:
Yar Kravtsov
2025-06-03 06:50:52 +03:00
parent 3e6b426a19
commit 3cba309c05
6 changed files with 24 additions and 35 deletions

View File

@@ -16,12 +16,7 @@ func newPullCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
host, _ := cmd.Flags().GetString("host")
var lnk *core.Lnk
if host != "" {
lnk = core.NewLnkWithHost(host)
} else {
lnk = core.NewLnk()
}
lnk := core.NewLnk(core.WithHost(host))
restored, err := lnk.Pull()
if err != nil {