nyaruka / phonenumbers

GoLang port of Google's libphonenumber library
MIT License
1.25k stars 148 forks source link

build broken within go.work setup. works fine outside go.work setup #165

Closed gedw99 closed 6 months ago

gedw99 commented 6 months ago
BIN_ROOT:=$(PWD)/.bin
NAME:= phonenumbers
cd $(NAME)/cmd/buildmetadata && go mod tidy
cd $(NAME)/cmd/buildmetadata && go build -o $(BIN_ROOT)/$(NAME)_buildmetadata  main.go
cd $(NAME)/cmd/phoneparser && go mod tidy
    cd $(NAME)/cmd/phoneparser && go build -o $(BIN_ROOT)/$(NAME)_phoneparser main.go

cd $(NAME)/cmd/phoneserver && go mod tidy
cd $(NAME)/cmd/phoneserver && go get github.com/aws/aws-lambda-go/events
cd $(NAME)/cmd/phoneserver && go get github.com/aws/aws-lambda-go/lambda
cd $(NAME)/cmd/phoneserver && go mod tidy
cd $(NAME)/cmd/phoneserver && go build -o $(BIN_ROOT)/$(NAME)_phoneserver main.go

cd phonenumbers/cmd/buildmetadata && go mod tidy
cd phonenumbers/cmd/buildmetadata && go build -o /.bin/phonenumbers_buildmetadata main.go
cd phonenumbers/cmd/phoneparser && go mod tidy
cd phonenumbers/cmd/phoneparser && go build -o /.bin/phonenumbers_phoneparser main.go
cd phonenumbers/cmd/phoneserver && go mod tidy
cd phonenumbers/cmd/phoneserver && go get github.com/aws/aws-lambda-go/events
cd phonenumbers/cmd/phoneserver && go get github.com/aws/aws-lambda-go/lambda
cd phonenumbers/cmd/phoneserver && go mod tidy
cd phonenumbers/cmd/phoneserver && go build -o /.bin/phonenumbers_phoneserver main.go
main.go:7:2: no required module provides package github.com/aws/aws-lambda-go/events; to add it:
        go get github.com/aws/aws-lambda-go/events
main.go:8:2: no required module provides package github.com/aws/aws-lambda-go/lambda; to add it:
        go get github.com/aws/aws-lambda-go/lambda
gedw99 commented 6 months ago

fixed

gedw99 commented 6 months ago

if you want a makefile fix just let me know.

go work use $(NAME)/cmd/buildmetadata
cd $(NAME)/cmd/buildmetadata && go build -o $(BIN_ROOT)/$(NAME)_buildmetadata main.go

go work use $(NAME)/cmd/phoneparser
    cd $(NAME)/cmd/phoneparser && go build -o $(BIN_ROOT)/$(NAME)_phoneparser main.go

go work use $(NAME)/cmd/phoneserver
cd $(NAME)/cmd/phoneserver && go build -o $(BIN_ROOT)/$(NAME)_phoneserver main.go