Skip to content

Adds unused fmt library #4

@ximyro

Description

@ximyro

Description

Effe adds the import of fmt library.

Example from tests

package main

import (
	"fmt"
	"net/http"
)

func A(service AService) AFunc {
	return func() (http.Request, error) {
		err := service.Step1()
		if err != nil {
			return http.Request{}, err
		}
		requestVal, err := service.Step2()
		if err != nil {
			return requestVal, err
		}
		return requestVal, nil
	}
}
func NewAImpl() *AImpl {
	return &AImpl{step1FieldFunc: step1(), step2FieldFunc: step2()}
}

type AService interface {
	Step1() error
	Step2() (http.Request, error)
}
type AImpl struct {
	step1FieldFunc func() error
	step2FieldFunc func() (http.Request, error)
}
type AFunc func() (http.Request, error)

func (a *AImpl) Step1() error                 { return a.step1FieldFunc() }
func (a *AImpl) Step2() (http.Request, error) { return a.step2FieldFunc() }

How to resolve it?

Disable adding this library when it's not used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions