Skip to content

Commit 435515e

Browse files
author
Shubham Chaturvedi
committed
fix: PR comments
1 parent 19a8195 commit 435515e

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

StandardLibrary/runtimes/go/ImplementationFromDafny-go/DafnyLibraries/externs.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ func (_this *MutableMap) Items() _dafny.Set {
104104
}
105105
func (_this *MutableMap) Select(k interface{}) interface{} {
106106
r := _this.Get(k)
107-
if r.IsFailure() {
108-
panic("ff")
107+
if r.Is_None() {
108+
return nil
109109
}
110110
return r.Dtor_value()
111111
}
@@ -141,5 +141,3 @@ func (_this *MutableMap) Size() _dafny.Int {
141141
return c
142142
}
143143
}
144-
145-
// End of class MutableMap

StandardLibrary/runtimes/go/ImplementationFromDafny-go/UUID/externs.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package UUID
22

33
import (
4-
"fmt"
5-
64
"github.com/dafny-lang/DafnyRuntimeGo/v4/dafny"
75
"github.com/dafny-lang/DafnyStandardLibGo/Wrappers"
86
"github.com/google/uuid"
@@ -24,11 +22,11 @@ func ToByteArray(seq dafny.Sequence) Wrappers.Result {
2422

2523
func FromByteArray(seq dafny.Sequence) Wrappers.Result {
2624
byteArray := dafny.ToByteArray(seq)
27-
uuid, err := uuid.FromBytes(byteArray)
25+
fromBytes, err := uuid.FromBytes(byteArray)
2826
if err != nil {
29-
return Wrappers.Companion_Result_.Create_Failure_(fmt.Errorf("Failed To Generate UUID From Byte Array"))
27+
return Wrappers.Companion_Result_.Create_Failure_(err)
3028
}
31-
return Wrappers.Companion_Result_.Create_Success_(dafny.SeqOfChars([]dafny.Char(uuid.String())...))
29+
return Wrappers.Companion_Result_.Create_Success_(dafny.SeqOfChars([]dafny.Char(fromBytes.String())...))
3230
}
3331

3432
func GenerateUUID() Wrappers.Result {

0 commit comments

Comments
 (0)