@@ -59,8 +59,8 @@ func TestCreateAndDeleteWorkspaceFromWorkspace(t *testing.T) {
5959 t .Fatalf ("Error reading file: %v" , err )
6060 }
6161
62- if ! bytes .Equal (content . Content , []byte ("hello world" )) {
63- t .Errorf ("Unexpected content: %s" , content . Content )
62+ if ! bytes .Equal (content , []byte ("hello world" )) {
63+ t .Errorf ("Unexpected content: %s" , content )
6464 }
6565
6666 err = g .DeleteWorkspace (context .Background (), id )
@@ -92,26 +92,22 @@ func TestWriteReadAndDeleteFileFromWorkspace(t *testing.T) {
9292 t .Errorf ("Error reading file: %v" , err )
9393 }
9494
95- if ! bytes .Equal (content .Content , []byte ("test" )) {
96- t .Errorf ("Unexpected content: %s" , content .Content )
97- }
98-
99- if content .RevisionID != "" {
100- t .Errorf ("Unexpected file revision ID when not requesting it: %s" , content .RevisionID )
95+ if ! bytes .Equal (content , []byte ("test" )) {
96+ t .Errorf ("Unexpected content: %s" , content )
10197 }
10298
10399 // Read the file and request the revision ID
104- content , err = g .ReadFileInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id , WithLatestRevisionID : true })
100+ contentWithRevision , err : = g .ReadFileWithRevisionInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id })
105101 if err != nil {
106102 t .Errorf ("Error reading file: %v" , err )
107103 }
108104
109- if ! bytes .Equal (content .Content , []byte ("test" )) {
110- t .Errorf ("Unexpected content: %s" , content .Content )
105+ if ! bytes .Equal (contentWithRevision .Content , []byte ("test" )) {
106+ t .Errorf ("Unexpected content: %s" , contentWithRevision .Content )
111107 }
112108
113- if content .RevisionID == "" {
114- t .Errorf ("Expected file revision ID when requesting it: %s" , content .RevisionID )
109+ if contentWithRevision .RevisionID == "" {
110+ t .Errorf ("Expected file revision ID when requesting it: %s" , contentWithRevision .RevisionID )
115111 }
116112
117113 // Stat the file to ensure it exists
@@ -553,8 +549,8 @@ func TestCreateAndDeleteWorkspaceFromWorkspaceS3(t *testing.T) {
553549 t .Errorf ("Error reading file: %v" , err )
554550 }
555551
556- if ! bytes .Equal (content . Content , []byte ("hello world" )) {
557- t .Errorf ("Unexpected content: %s" , content . Content )
552+ if ! bytes .Equal (content , []byte ("hello world" )) {
553+ t .Errorf ("Unexpected content: %s" , content )
558554 }
559555
560556 err = g .DeleteWorkspace (context .Background (), id )
@@ -597,8 +593,8 @@ func TestCreateAndDeleteDirectoryWorkspaceFromWorkspaceS3(t *testing.T) {
597593 t .Errorf ("Error reading file: %v" , err )
598594 }
599595
600- if ! bytes .Equal (content . Content , []byte ("hello world" )) {
601- t .Errorf ("Unexpected content: %s" , content . Content )
596+ if ! bytes .Equal (content , []byte ("hello world" )) {
597+ t .Errorf ("Unexpected content: %s" , content )
602598 }
603599
604600 err = g .DeleteWorkspace (context .Background (), id )
@@ -648,8 +644,8 @@ func TestCreateAndDeleteS3WorkspaceFromWorkspaceDirectory(t *testing.T) {
648644 t .Fatalf ("Error reading file: %v" , err )
649645 }
650646
651- if ! bytes .Equal (content . Content , []byte ("hello world" )) {
652- t .Errorf ("Unexpected content: %s" , content . Content )
647+ if ! bytes .Equal (content , []byte ("hello world" )) {
648+ t .Errorf ("Unexpected content: %s" , content )
653649 }
654650
655651 err = g .DeleteWorkspace (context .Background (), id )
@@ -685,26 +681,22 @@ func TestWriteReadAndDeleteFileFromWorkspaceS3(t *testing.T) {
685681 t .Errorf ("Error reading file: %v" , err )
686682 }
687683
688- if ! bytes .Equal (content .Content , []byte ("test" )) {
689- t .Errorf ("Unexpected content: %s" , content .Content )
690- }
691-
692- if content .RevisionID != "" {
693- t .Errorf ("Unexpected file revision ID when not requesting it: %s" , content .RevisionID )
684+ if ! bytes .Equal (content , []byte ("test" )) {
685+ t .Errorf ("Unexpected content: %s" , content )
694686 }
695687
696688 // Read the file and request the revision ID
697- content , err = g .ReadFileInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id , WithLatestRevisionID : true })
689+ contentWithRevision , err : = g .ReadFileWithRevisionInWorkspace (context .Background (), "test.txt" , ReadFileInWorkspaceOptions {WorkspaceID : id })
698690 if err != nil {
699691 t .Errorf ("Error reading file: %v" , err )
700692 }
701693
702- if ! bytes .Equal (content .Content , []byte ("test" )) {
703- t .Errorf ("Unexpected content: %s" , content .Content )
694+ if ! bytes .Equal (contentWithRevision .Content , []byte ("test" )) {
695+ t .Errorf ("Unexpected content: %s" , contentWithRevision .Content )
704696 }
705697
706- if content .RevisionID == "" {
707- t .Errorf ("Expected file revision ID when requesting it: %s" , content .RevisionID )
698+ if contentWithRevision .RevisionID == "" {
699+ t .Errorf ("Expected file revision ID when requesting it: %s" , contentWithRevision .RevisionID )
708700 }
709701
710702 // Stat the file to ensure it exists
0 commit comments