@@ -23,14 +23,14 @@ func main() {
2323 log .Fatalf ("Usage: %s <cassette_file_name_without_yaml>\n " , os .Args [0 ])
2424 }
2525
26- chemin := os .Args [1 ]
26+ path := os .Args [1 ]
2727
28- inputCassette , err := cassette .Load (chemin )
28+ inputCassette , err := cassette .Load (path )
2929 if err != nil {
3030 log .Fatalf ("Error while reading file : %v\n " , err )
3131 }
3232
33- outputCassette := cassette .New (chemin )
33+ outputCassette := cassette .New (path )
3434 transitioning := false
3535
3636 for i := range len (inputCassette .Interactions ) {
@@ -71,29 +71,27 @@ func main() {
7171 continue
7272 }
7373
74- if m ["status" ] != nil {
75- // We test if the state is transient
76- if _ , ok := transientStates [m ["status" ].(string )]; ok {
77- if transitioning {
78- log .Printf ("Interaction %d is in a transient state while we are already in transitient state. No need to record it: %s\n " , i , m ["status" ])
74+ // We test if the state is transient
75+ if _ , ok := transientStates [m ["status" ].(string )]; ok {
76+ if transitioning {
77+ log .Printf ("Interaction %d is in a transient state while we are already in transitient state. No need to record it: %s\n " , i , m ["status" ])
7978
80- continue
81- } else {
82- transitioning = true
79+ continue
80+ } else {
81+ transitioning = true
82+
83+ log .Printf ("Interaction %d is in a transient state: %s, Recording it\n " , i , m ["status" ])
84+ outputCassette .AddInteraction (interaction )
85+ }
86+ } else {
87+ if transitioning {
88+ log .Printf ("Interaction %d is not in a transient state anymore: %s, Recording it\n " , i , m ["status" ])
89+ outputCassette .AddInteraction (interaction )
8390
84- log .Printf ("Interaction %d is in a transient state: %s, Recording it\n " , i , m ["status" ])
85- outputCassette .AddInteraction (interaction )
86- }
91+ transitioning = false
8792 } else {
88- if transitioning {
89- log .Printf ("Interaction %d is not in a transient state anymore: %s, Recording it\n " , i , m ["status" ])
90- outputCassette .AddInteraction (interaction )
91-
92- transitioning = false
93- } else {
94- log .Printf ("Interaction %d is not in a transient state: %s, Recording it\n " , i , m ["status" ])
95- outputCassette .AddInteraction (interaction )
96- }
93+ log .Printf ("Interaction %d is not in a transient state: %s, Recording it\n " , i , m ["status" ])
94+ outputCassette .AddInteraction (interaction )
9795 }
9896 }
9997 }
0 commit comments