C#2d Attacking multiple enemies rather than one

Hello! I have a list of enemies currently on the map. And my player will target the one that’s closest to him. Problem is, I want to make the player target more than one of the enemies if they are in attack range of the player. Right now I’m just targetting one at the time, so I guess that’s where the fault lies. How do I go about making my targets potentially multiple?
Relevant code for enemy list:

    private GameObject target;

	//List-array to find enemies
	GameObject FindClosestEnemy() {
		GameObject[] gos;
		gos = GameObject.FindGameObjectsWithTag("Enemy");
		GameObject closest = null;
		maxDistance = 50f;
		Vector3 position = transform.position;
		foreach (GameObject enemy in gos) {
			Vector3 diff = enemy.transform.position - position;
			float curDistance = diff.sqrMagnitude;
			if (curDistance < maxDistance) {
				closest = enemy;
				maxDistance = curDistance;
			}
		}
		return closest;
	}

Then I declare before the player attack:
GameObject target = FindClosestEnemy();

I hope you can bare with me, and I appreciate any help. I am still quite inept, haha!

You can create a List of closest enemies to store the close enemies. So your method for finding close enemies become:

List<GameObject> FindCloseEnemies() {
     GameObject[] gos;
     gos = GameObject.FindGameObjectsWithTag("Enemy");
	 // We store the close enemies in the list
	 List<GameObject> closest = new List<GameObject>();
     maxDistance = 50f;
     Vector3 position = transform.position;
     foreach (GameObject enemy in gos) {
         Vector3 diff = enemy.transform.position - position;
         float curDistance = diff.sqrMagnitude;
         if (curDistance < maxDistance) {
			// We add the enemy to the list if it is close
			closest.Add(enemy);
         }
     }
     return closest;
 }

And you can call this like:

 List<GameObject> closeEnemies = FindCloseEnemies();

Now you can process your closeEnemies list to perform the operation of attack or anything else since it contains the close enemies.

Try something like the follow… i think another person above mentioned something along these lines as well.

public  Gameobject findClosest(Gameobject[] enemies)
        	{
        		float minDistanceTargClosest=100;
        		Gameobject closest=null;
    			Vector3 myPosition = transform.position;
    			
        		for (int a=0; a<enemies.Length;a++)
        		{

    				float distance = Vector3.Distance (myPosition, enemies[a].transform.position);
    
        			if(distance<minDistanceTargClosest)
        			{
        					minDistanceTargClosest=distance;
        					closest=enemies[a];
        			}
        		}
        		return closest;
        	}