55
66 "github.com/chenasraf/sofmani/appconfig"
77 "github.com/chenasraf/sofmani/logger"
8+ "github.com/samber/lo"
89)
910
1011func newAptInstaller (data * appconfig.InstallerData ) * AptInstaller {
@@ -21,7 +22,7 @@ func TestAptValidation(t *testing.T) {
2122 logger .InitLogger (false )
2223 aptInstaller := newAptInstaller (
2324 & appconfig.InstallerData {
24- Name : strPtr ("test-apt" ),
25+ Name : lo . ToPtr ("test-apt" ),
2526 Type : appconfig .InstallerTypeApt ,
2627 },
2728 )
@@ -33,7 +34,7 @@ func TestAptGetOpts(t *testing.T) {
3334
3435 // Test default opts (no options set)
3536 defaultData := & appconfig.InstallerData {
36- Name : strPtr ("vim" ),
37+ Name : lo . ToPtr ("vim" ),
3738 Type : appconfig .InstallerTypeApt ,
3839 }
3940 installer := newAptInstaller (defaultData )
@@ -50,7 +51,7 @@ func TestAptGetOpts(t *testing.T) {
5051
5152 // Test with flags option
5253 flagsData := & appconfig.InstallerData {
53- Name : strPtr ("vim" ),
54+ Name : lo . ToPtr ("vim" ),
5455 Type : appconfig .InstallerTypeApt ,
5556 Opts : & map [string ]any {
5657 "flags" : "-y --no-install-recommends" ,
@@ -64,7 +65,7 @@ func TestAptGetOpts(t *testing.T) {
6465
6566 // Test with install_flags option
6667 installFlagsData := & appconfig.InstallerData {
67- Name : strPtr ("vim" ),
68+ Name : lo . ToPtr ("vim" ),
6869 Type : appconfig .InstallerTypeApt ,
6970 Opts : & map [string ]any {
7071 "install_flags" : "--no-install-recommends" ,
@@ -78,7 +79,7 @@ func TestAptGetOpts(t *testing.T) {
7879
7980 // Test with update_flags option
8081 updateFlagsData := & appconfig.InstallerData {
81- Name : strPtr ("vim" ),
82+ Name : lo . ToPtr ("vim" ),
8283 Type : appconfig .InstallerTypeApt ,
8384 Opts : & map [string ]any {
8485 "update_flags" : "--only-upgrade" ,
@@ -92,7 +93,7 @@ func TestAptGetOpts(t *testing.T) {
9293
9394 // Test with all flags options combined
9495 allFlagsData := & appconfig.InstallerData {
95- Name : strPtr ("vim" ),
96+ Name : lo . ToPtr ("vim" ),
9697 Type : appconfig .InstallerTypeApt ,
9798 Opts : & map [string ]any {
9899 "flags" : "--common" ,
0 commit comments