Skip to content

go writer: bad output because of test packages. no output for non code files #61

@Hoblovski

Description

@Hoblovski

Describe the bug

  1. The generated AST contains test packages
      "Packages": {
        "github.com/cloudwego/localsession": {
	"github.com/cloudwego/localsession [github.com/cloudwego/localsession.test]": {
	...
  1. The writer does not write non-code files like README.md

Which causes the writer to produce incorrect results

.
├── backup
│   └── metainfo.go
├── backup [github.com
│   └── cloudwego
│       └── localsession
│           └── backup.test]
│               ├── metainfo.go
│               └── metainfo_test.go
├──  [github.com
│   └── cloudwego
│       └── localsession.test]
│           ├── api_test.go
│           ├── example_test.go
│           ├── gls.go
│           ├── manager.go
│           ├── session.go
│           └── stubs.go
├── gls.go
├── go.mod
├── manager.go
├── session.go
└── stubs.go

The expected output is

.
├── api_test.go
├── backup
│   ├── metainfo.go
│   └── metainfo_test.go
├── check_branch_name.sh
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── example_test.go
├── gls.go
├── go.mod
├── go.sum
├── LICENSE-APACHE
├── manager.go
├── README.md
├── session.go
├── stubs.go
└── _typos.toml

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Version:

Please provide the version of {project_name} you are using.

Environment:

The output of go env.

Additional context

Add any other context about the problem here.

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