Skip to content

"Error: an error occured while trying to parse imports: path is missing starting quotes" on valid Go file #48

Closed
@charleskorn

Description

@charleskorn

If I have a file that contains this content:

package main

import (
	/*
		#include "types.h"
	*/
	"C"
)

...and invoke gci with gci diff --debug file.go, I get this error:

2022/03/01 11:42:07 Loaded File: file.go
Error: an error occured while trying to parse imports: path is missing starting quotes

Is this expected? I can't see what the issue is.

Removing the /* ... */ causes gci to not fail with an error, but I can't remove that comment as cgo relies on it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions