MCPcopy Create free account
hub / github.com/dagger/dagger / Same

Method Same

core/module.go:2101–2118  ·  view source on GitHub ↗
(other Mod)

Source from the content-addressed store, hash-verified

2099}
2100
2101func (mod *userMod) Same(other Mod) (bool, error) {
2102 otherUser, ok := other.(*userMod)
2103 if !ok {
2104 return false, nil
2105 }
2106 id, err := mod.res.ID()
2107 if err != nil {
2108 return false, fmt.Errorf("user module %q identity: %w", mod.Name(), err)
2109 }
2110 otherID, err := otherUser.res.ID()
2111 if err != nil {
2112 return false, fmt.Errorf("user module %q identity: %w", otherUser.Name(), err)
2113 }
2114 if id == nil || otherID == nil {
2115 return false, nil
2116 }
2117 return id.EngineResultID() == otherID.EngineResultID(), nil
2118}
2119
2120func (mod *userMod) View() (call.View, bool) {
2121 if self := mod.self(); self != nil {

Callers

nothing calls this directly

Calls 4

NameMethod · 0.95
EngineResultIDMethod · 0.80
IDMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected