Skip to content

Wrong position of package comment if template has no own import #20

@vpbarb

Description

@vpbarb

If template has own import section (e.g. with github.com/prometheus/client_golang/prometheus) then the generated file header looks correct :

package name

// DO NOT EDIT!
// This code is generated with http://github.com/hexdigest/gowrap tool
// using templates/metrics template

import (
	"context"
	
	"github.com/prometheus/client_golang/prometheus"
)

But if template doesn't have own import section then package comment goes after import in generated file. It looks bad:

package name

import (
	"context"
)

// DO NOT EDIT!
// This code is generated with http://github.com/hexdigest/gowrap tool
// using templates/metrics template

import() in the beginning of template fixes it but looks weird.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions