Skip to content

export and extern not working #4042

@jclab-joseph

Description

@jclab-joseph
package main

import (
	"fmt"
)

func main() {
	fmt.Println("ptr: ", ptr)
}


//export test
func test(a int) {
	fmt.Println("tets ", a)
}


//go:extern test
var ptr uintptr

Result:

function declaration may only have a unique !dbg attachment
ptr @test.4
error: verification error after compiling package command-line-arguments

I want to get a pointer to an exported function without the syscall package.

I am implementing scheduler.threads for contribute.
There is a need for a way to obtain a function pointer without circular references due to syscall in internal/task.

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