If the feces are particularly long and stringy, it is possible that your goldfish is constipated. Constipation can be caused by a variety of factors, such as a diet that is too high in protein or fiber, or a lack of exercise. If you think your goldfish is constipated, you can try feeding it a diet that is higher in moisture, such as live or frozen food. You can also try increasing the amount of exercise your goldfish gets by swimming it in a larger tank or by adding some toys to its tank.
If the feces are accompanied by other symptoms, such as lethargy, loss of appetite, or difficulty swimming, it is important to take your goldfish to the vet. These symptoms could indicate a more serious health problem, such as an infection or parasites.