Skip to content

Commit

Permalink
Merge pull request #4 from blinklabs-io/fix/linter-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas authored Sep 8, 2023
2 parents d2400ca + ff950e2 commit f07521d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
version: v1.53.3 # current version at time of commit
args: --timeout=10m
# We disable the 'unused' linter check to avoid annoying linter warnings during initial development
args: --timeout=10m --disable unused
only-new-issues: true
- name: go-test
run: go test ./...
8 changes: 5 additions & 3 deletions machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,21 @@ func CreateMachine(slippage uint32) Machine {

func (m *Machine) Run(term *Term[NamedDeBruijn]) (Term[NamedDeBruijn], error) {
startupBudget := m.costs.machineCosts.startup
m.spendBudget(startupBudget)
if err := m.spendBudget(startupBudget); err != nil {
return nil, err
}

var state MachineState = Compute{ctx: NoFrame{}, env: make([]Value, 0), term: term}

var err error
for {
switch state.(type) {
switch v := state.(type) {
case Compute:
state, err = m.compute()
case Return:
state, err = m.returnCompute()
case Done:
return state.(Done).term, nil
return v.term, nil
}

if err != nil {
Expand Down

0 comments on commit f07521d

Please sign in to comment.