Skip to content

Commit

Permalink
go: update to ubuntu:24.04 and convert to go.mod style
Browse files Browse the repository at this point in the history
  • Loading branch information
kanaka committed Aug 5, 2024
1 parent e4a92b1 commit a683fdb
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 68 deletions.
7 changes: 5 additions & 2 deletions impls/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04
MAINTAINER Joel Martin <[email protected]>

##########################################################
Expand All @@ -19,4 +19,7 @@ WORKDIR /mal
# Specific implementation requirements
##########################################################

RUN DEBIAN_FRONTEND=noninteractive apt-get -y install g++ golang libedit-dev pkg-config
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install g++ golang libreadline-dev libedit-dev pkg-config

ENV HOME /mal
ENV GOPATH /mal/impls/go/
4 changes: 1 addition & 3 deletions impls/go/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export GOPATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

#####################

SOURCES_BASE = src/types/types.go src/readline/readline.go \
Expand All @@ -24,7 +22,7 @@ mal: $(word $(words $(BINS)),$(BINS))

define dep_template
$(1): $(SOURCES_BASE) src/$(1)/$(1).go
go build $$@
go build -o $$@ ./src/$(1)
endef

$(foreach b,$(BINS),$(eval $(call dep_template,$(b))))
Expand Down
8 changes: 4 additions & 4 deletions impls/go/src/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
)

import (
"printer"
"reader"
"readline"
. "types"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// Errors/Exceptions
Expand Down
2 changes: 1 addition & 1 deletion impls/go/src/env/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

import (
. "types"
. "mal/src/types"
)

type Env struct {
Expand Down
2 changes: 1 addition & 1 deletion impls/go/src/printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

import (
"types"
"mal/src/types"
)

func Pr_list(lst []types.MalType, pr bool,
Expand Down
2 changes: 1 addition & 1 deletion impls/go/src/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

import (
. "types"
. "mal/src/types"
)

type Reader interface {
Expand Down
2 changes: 1 addition & 1 deletion impls/go/src/step0_repl/step0_repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

import (
"readline"
"mal/src/readline"
)

// read
Expand Down
8 changes: 4 additions & 4 deletions impls/go/src/step1_read_print/step1_read_print.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
)

import (
"printer"
"reader"
"readline"
. "types"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
8 changes: 4 additions & 4 deletions impls/go/src/step2_eval/step2_eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
)

import (
"printer"
"reader"
"readline"
. "types"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
10 changes: 5 additions & 5 deletions impls/go/src/step3_env/step3_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
)

import (
. "env"
"printer"
"reader"
"readline"
. "types"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
12 changes: 6 additions & 6 deletions impls/go/src/step4_if_fn_do/step4_if_fn_do.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
)

import (
"core"
. "env"
"printer"
"reader"
"readline"
. "types"
"mal/src/core"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
12 changes: 6 additions & 6 deletions impls/go/src/step5_tco/step5_tco.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
)

import (
"core"
. "env"
"printer"
"reader"
"readline"
. "types"
"mal/src/core"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
12 changes: 6 additions & 6 deletions impls/go/src/step6_file/step6_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
)

import (
"core"
. "env"
"printer"
"reader"
"readline"
. "types"
"mal/src/core"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
12 changes: 6 additions & 6 deletions impls/go/src/step7_quote/step7_quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
)

import (
"core"
. "env"
"printer"
"reader"
"readline"
. "types"
"mal/src/core"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
12 changes: 6 additions & 6 deletions impls/go/src/step8_macros/step8_macros.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
)

import (
"core"
. "env"
"printer"
"reader"
"readline"
. "types"
"mal/src/core"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
12 changes: 6 additions & 6 deletions impls/go/src/step9_try/step9_try.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
)

import (
"core"
. "env"
"printer"
"reader"
"readline"
. "types"
"mal/src/core"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down
12 changes: 6 additions & 6 deletions impls/go/src/stepA_mal/stepA_mal.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
)

import (
"core"
. "env"
"printer"
"reader"
"readline"
. "types"
"mal/src/core"
. "mal/src/env"
"mal/src/printer"
"mal/src/reader"
"mal/src/readline"
. "mal/src/types"
)

// read
Expand Down

0 comments on commit a683fdb

Please sign in to comment.