@@ -37,7 +37,7 @@ Host 10.200.1.46
3737 assert .NoError (t , err )
3838
3939 hosts := mgr .GetHosts ()
40- // Total hosts: Host *, prod-web-01, 10.200.1.46
40+ // total hosts: Host *, prod-web-01, 10.200.1.46
4141 assert .Len (t , hosts , 3 )
4242
4343 var wildcardHost , prodHost , dbHost * Host
@@ -56,17 +56,17 @@ Host 10.200.1.46
5656 assert .True (t , wildcardHost .IsWildcard )
5757 assert .Equal (t , "default_user" , wildcardHost .User )
5858
59- // Verify prodHost details and explicit key mapping
59+ // verify prodHost details and explicit key mapping
6060 assert .NotNil (t , prodHost )
6161 assert .False (t , prodHost .IsWildcard )
6262 assert .Equal (t , "10.200.1.45" , prodHost .Name )
6363 assert .Equal (t , "deploy" , prodHost .User )
6464 assert .Equal (t , "~/.ssh/keys/work_rsa" , prodHost .IdentityFile )
65- // Verify prodHost inherited port 2222 from wildcard Host *
65+ // verify prodHost inherited port 2222 from wildcard Host *
6666 assert .Equal (t , "2222" , prodHost .ResolvedProperties ["Port" ])
6767 assert .Equal (t , "yes" , prodHost .ResolvedProperties [keyForwardAgent ])
6868
69- // Verify dbHost does not have alias (its alias is the IP itself)
69+ // verify dbHost does not have alias (its alias is the IP itself)
7070 assert .NotNil (t , dbHost )
7171 assert .Equal (t , "10.200.1.46" , dbHost .Alias )
7272 // dbHost should inherit User, Port, and ForwardAgent from wildcard
@@ -136,7 +136,7 @@ Host my-host
136136 err = mgr .AddHost (primaryPath , newHost )
137137 assert .NoError (t , err )
138138
139- // Reload to verify write
139+ // reload to verify write
140140 mgr2 := NewManager (primaryPath )
141141 err = mgr2 .Load ()
142142 assert .NoError (t , err )
@@ -169,7 +169,7 @@ Host my-host
169169 err = mgr2 .UpdateHost ("added-host" , updatedHost )
170170 assert .NoError (t , err )
171171
172- // Reload to verify update
172+ // reload to verify update
173173 mgr3 := NewManager (primaryPath )
174174 err = mgr3 .Load ()
175175 assert .NoError (t , err )
@@ -193,7 +193,7 @@ Host my-host
193193 err = mgr3 .DeleteHost ("added-host-new" )
194194 assert .NoError (t , err )
195195
196- // Reload to verify delete
196+ // reload to verify delete
197197 mgr4 := NewManager (primaryPath )
198198 err = mgr4 .Load ()
199199 assert .NoError (t , err )
@@ -213,21 +213,21 @@ func TestManagerConfigFileCRUD(t *testing.T) {
213213
214214 subPath := filepath .Join (tmpDir , "sub-config" )
215215
216- // 1. Add Config File
216+ // 1. add config file
217217 err = mgr .AddConfigFile (subPath )
218218 assert .NoError (t , err )
219219 assert .FileExists (t , subPath )
220220 assert .Contains (t , mgr .FileOrder , subPath )
221221
222- // Check if Include directive is added in primary
222+ // check if Include directive is added in primary
223223 // #nosec G304
224224 primaryContent , err := os .ReadFile (primaryPath )
225225 assert .NoError (t , err )
226226 relSub , err := filepath .Rel (filepath .Dir (primaryPath ), subPath )
227227 assert .NoError (t , err )
228228 assert .Contains (t , string (primaryContent ), "Include " + relSub )
229229
230- // 2. Rename Config File
230+ // 2. rename config file
231231 renamedPath := filepath .Join (tmpDir , "renamed-config" )
232232 err = mgr .RenameConfigFile (subPath , renamedPath )
233233 assert .NoError (t , err )
@@ -236,7 +236,7 @@ func TestManagerConfigFileCRUD(t *testing.T) {
236236 assert .Contains (t , mgr .FileOrder , renamedPath )
237237 assert .NotContains (t , mgr .FileOrder , subPath )
238238
239- // Check if Include is updated in primary
239+ // check if Include is updated in primary
240240 // #nosec G304
241241 primaryContent2 , err := os .ReadFile (primaryPath )
242242 assert .NoError (t , err )
@@ -245,7 +245,7 @@ func TestManagerConfigFileCRUD(t *testing.T) {
245245 assert .Contains (t , string (primaryContent2 ), "Include " + relRenamed )
246246 assert .NotContains (t , string (primaryContent2 ), "Include " + relSub )
247247
248- // 3. Prevent deleting if connections are present
248+ // 3. prevent deleting if connections are present
249249 h := & Host {
250250 Alias : "test-host" ,
251251 Name : "127.0.0.1" ,
@@ -257,17 +257,17 @@ func TestManagerConfigFileCRUD(t *testing.T) {
257257 assert .Error (t , err )
258258 assert .Contains (t , err .Error (), "connections are still present" )
259259
260- // Delete host first
260+ // delete host first
261261 err = mgr .DeleteHost ("test-host" )
262262 assert .NoError (t , err )
263263
264- // 4. Delete Config File successfully when no connections are present
264+ // 4. delete config file successfully when no connections are present
265265 err = mgr .DeleteConfigFile (renamedPath )
266266 assert .NoError (t , err )
267267 assert .NoFileExists (t , renamedPath )
268268 assert .NotContains (t , mgr .FileOrder , renamedPath )
269269
270- // Check if Include is removed from primary
270+ // check if Include is removed from primary
271271 // #nosec G304
272272 primaryContent3 , err := os .ReadFile (primaryPath )
273273 assert .NoError (t , err )
0 commit comments