Skip to content

Write a C package in Go #1165

@xushiwei

Description

@xushiwei
package C

import "github.com/goplus/lib/c"

func Xadd(a, b c.Int) c.Int {
    return a + b
}

func Double(x float64) float64 {
    return 2 * x
}

is equivalent to

int add(int a, int b) {
    return a + b;
}

double Double(double x) {
    return 2 * x;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions